Created
August 10, 2014 17:52
-
-
Save kmdsbng/b3c6336057861caec45f to your computer and use it in GitHub Desktop.
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
| # -*- encoding: utf-8 -*- | |
| def main | |
| Module.nesting # => [] | |
| c = A::B::C.new | |
| c.b_method | |
| c.c_method | |
| end | |
| module A | |
| Module.nesting # => [A] | |
| module B | |
| Module.nesting # => [A::B, A] | |
| class C | |
| Module.nesting # => [A::B::C, A::B, A] | |
| def initialize | |
| Module.nesting # => [A::B::C, A::B, A] | |
| end | |
| def c_method | |
| Module.nesting # => [A::B::C, A::B, A] | |
| end | |
| include B | |
| end | |
| def b_method | |
| Module.nesting # => [A::B, A] | |
| end | |
| end | |
| end | |
| case $PROGRAM_NAME | |
| when __FILE__ | |
| main | |
| when /spec[^\/]*$/ | |
| # {spec of the implementation} | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment