Created
May 16, 2013 00:37
-
-
Save mdub/5588589 to your computer and use it in GitHub Desktop.
Ruby module include order matters!
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 M; end | |
module Soup; end | |
class C; include M; end | |
module M; include Soup; end | |
C.ancestors #=> [C, M, Object, Kernel, BasicObject] |
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 M; end | |
module Soup; end | |
module M; include Soup; end | |
class C; include M; end | |
C.ancestors #=> [C, A, Soup, Object, Kernel, BasicObject] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment