Skip to content

Instantly share code, notes, and snippets.

@stephanschubert
Created March 26, 2015 07:35
Show Gist options
  • Save stephanschubert/b3706f44c95be76da9e8 to your computer and use it in GitHub Desktop.
Save stephanschubert/b3706f44c95be76da9e8 to your computer and use it in GitHub Desktop.
Delegate methods privately (requires ActiveSupport)
class Module
def private_delegate(*methods)
delegate(*methods)
methods.extract_options!
methods.each { |m| private(m) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment