Skip to content

Instantly share code, notes, and snippets.

@gonzedge
Created December 30, 2016 01:17
Show Gist options
  • Save gonzedge/76f2673daf88cabb378381fd3bf3d38a to your computer and use it in GitHub Desktop.
Save gonzedge/76f2673daf88cabb378381fd3bf3d38a to your computer and use it in GitHub Desktop.
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