Created
December 18, 2018 13:14
-
-
Save cyrilchampier/2860f161962d6dcd78be5164c7735129 to your computer and use it in GitHub Desktop.
broken code to demonstrate module nesting behavior
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 A1 | |
REACHABLE = true | |
module B1 | |
NESTING = Module.nesting | |
def self.reachable? | |
REACHABLE | |
end | |
end | |
end | |
module A2 | |
REACHABLE = false | |
end | |
module A2::B2 | |
NESTING = Module.nesting | |
def self.reachable? | |
REACHABLE | |
end | |
end | |
A1::B1::NESTING | |
A2::B2::NESTING | |
A1::B1.reachable? | |
A2::B2.reachable? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment