Skip to content

Instantly share code, notes, and snippets.

@kmdsbng
Created August 10, 2014 17:52
Show Gist options
  • Select an option

  • Save kmdsbng/b3c6336057861caec45f to your computer and use it in GitHub Desktop.

Select an option

Save kmdsbng/b3c6336057861caec45f to your computer and use it in GitHub Desktop.
# -*- 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