Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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