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
‹
›
Home
View web version
No comments:
Post a Comment