-
-
Save evaldasg/5db9bd7d3dc4b0a781e88d2bd9e8ec14 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
module A | |
module B | |
puts "module B inside module A nesting: #{Module.nesting}" | |
module_function | |
def show_nesting | |
puts "show_nesting nesting: #{Module.nesting}" | |
end | |
def yielder | |
yield | |
end | |
end | |
end | |
module A::B | |
puts "module A::B nesting: #{Module.nesting}" | |
end | |
A::B.show_nesting | |
A::B.yielder do | |
puts "A::B.yielder nesting: #{Module.nesting}" | |
end | |
include A::B | |
show_nesting | |
yielder do | |
puts "toplevel.yielder nesting: #{Module.nesting}" | |
end |
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 B inside module A nesting: [A::B, A] | |
module A::B nesting: [A::B] | |
show_nesting nesting: [A::B, A] | |
A::B.yielder nesting: [] | |
show_nesting nesting: [A::B, A] | |
toplevel.yielder nesting: [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment