Skip to content

Instantly share code, notes, and snippets.

@jonkarna
Created February 13, 2012 21:24
Show Gist options
  • Save jonkarna/1820619 to your computer and use it in GitHub Desktop.
Save jonkarna/1820619 to your computer and use it in GitHub Desktop.
Do multiple delegates with an array of hashes. Just an idea.
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