Created
March 26, 2015 07:35
-
-
Save stephanschubert/b3706f44c95be76da9e8 to your computer and use it in GitHub Desktop.
Delegate methods privately (requires ActiveSupport)
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
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