-
-
Save campbell/3841cc86b092a08df5f8 to your computer and use it in GitHub Desktop.
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
class Outer | |
puts Module.nesting | |
A = 'outer' | |
end | |
puts Outer::A #=> outer | |
class Outer | |
class Inner | |
puts Module.nesting | |
puts A #=> outer | |
end | |
end | |
class Outer::Inner | |
puts Module.nesting | |
puts A | |
# const_lookup.rb:13:in `<class:Inner>': uninitialized constant Outer::Inner::A (NameError) | |
# from const_lookup.rb:12:in `<main>' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment