A small tip to call methods dynamically using Ruby's send method.
["foo", "bar"].each do |method|
MyClass.send(method)
end
The above code is same as calling MyClass.foo and MyClass.bar.
Friday, January 29, 2010
A small Tip
Posted by venkat at 1:01 AM
Labels: Ruby on Rails
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment