Created
December 30, 2016 01:17
-
-
Save gonzedge/76f2673daf88cabb378381fd3bf3d38a to your computer and use it in GitHub Desktop.
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 self.delegate delegated_methods_to_delegated_to | |
delegated_methods_to_delegated_to.each do |methods, delegated_to| | |
methods.each do |method| | |
define_method method do |*args| | |
send(delegated_to).send method, *args | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment