Created
September 19, 2012 06:37
-
-
Save inre/3748030 to your computer and use it in GitHub Desktop.
Multi include
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
module Module1 | |
end | |
module Module2 | |
end | |
module Module3 | |
end | |
class MyClass | |
includes Module1, Module2, Module3 | |
end |
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 Class | |
private | |
def includes(*modules) | |
modules.each(&method(:include)) | |
nil | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment