This probably isn\'t something you should try at home, but for some reason or another I tried to create an array of methods in Ruby.
I started by defining two methods.>
What you're storing in your array is the result of calling your methods, not the methods themselves.
def test1
puts "foo!"
end
def test2
puts "bar!"
end
You can store references to the actual methods like this:
> arr = [method(:test1), method(:test2)]
# => [#, #]
Later, you can call the referenced methods like this:
> arr.each {|m| m.call }
foo!
bar!