Created
June 9, 2011 23:24
-
-
Save jish/1017985 to your computer and use it in GitHub Desktop.
Multi include
This file contains hidden or 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 One | |
| def method | |
| "one" | |
| end | |
| end | |
| module Two | |
| def method | |
| "two" | |
| end | |
| end | |
| class Foo | |
| include One | |
| include Two | |
| end | |
| puts Foo.new.method # => "two" | |
| class Bar | |
| include One | |
| include Two | |
| def method | |
| "bar" | |
| end | |
| end | |
| puts Bar.new.method # => "bar" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment