Created
April 22, 2015 13:04
-
-
Save dinks/8a1ed1ee14e5fc6209e5 to your computer and use it in GitHub Desktop.
Prepend versus 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 AA | |
def hi | |
end | |
end | |
class A | |
include AA | |
end | |
class B | |
prepend AA | |
end | |
p A.ancestors # [A, AA, Object, Kernel, BasicObject] | |
p B.ancestors # [AA, B, Object, Kernel, BasicObject] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment