Is there a better way to achieve the following? It seems a little clunky to list the methods as symbols...
This code runs an init
before and draw
after for each of the 4 methods. The following code works, but is there a more readable or idiomatic way of doing it?
Class DrawMap
def draw_method_1
...
end
def draw_method_2
...
end
def draw_all
[:draw_method_1, :draw_method_2, :draw_method_3, :draw_method_4].each do |method|
init_draw
send method
@draw.draw
end
end
...
The Rails before and after filters would do the same thing, but this is not a Rails app.
Ruby 1.9.3