Created
April 20, 2017 15:27
-
-
Save dannyc5/aa05e6380f670426384717361864fb80 to your computer and use it in GitHub Desktop.
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 B | |
def bee | |
p cee | |
end | |
end | |
module C | |
def cee | |
'hi' | |
end | |
end | |
class A | |
include B | |
include C | |
def hay | |
bee | |
end | |
end | |
a = A.new | |
a.hay # self is a, and all mixed-in methods are visible to a (in a's scope) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment