Venkat Adapa's Tech Blog
Friday, January 29, 2010
A small Tip
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.
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment