Created
February 13, 2012 21:24
-
-
Save jonkarna/1820619 to your computer and use it in GitHub Desktop.
Do multiple delegates with an array of hashes. Just an idea.
This file contains 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
def delegate_with_hash(to, array_of_hashes) | |
array_of_hashes.each do |h| | |
methods = Array[h.delete(:methods)] | |
delegate methods, h.merge(:to => to) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment