Created
March 15, 2010 17:21
-
-
Save foysavas/333070 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# anybody already using an Object monkey-patch like the one below: | |
class Object | |
def send_chain(v) | |
this = self | |
v.each { |k| this = this.send(*k) } | |
this | |
end | |
end | |
# example: | |
1.send_chain([[:*, 2], :to_s]) # => "2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment