Skip to content

Instantly share code, notes, and snippets.

@crguezl
Created January 27, 2013 09:30
Show Gist options
  • Save crguezl/4647549 to your computer and use it in GitHub Desktop.
Save crguezl/4647549 to your computer and use it in GitHub Desktop.
module Kernel
A=B=C=D=E=F="defined in Kernel"
end
#Top level or global constant defined in Object
A=B=C=D=E="defined at top-level"
class Super
A=B=C=D="defined in superclass"
end
module Included
A=B=C="defined in included module"
end
module Enclosing
A=B="defined in enclosing module"
class Local < Super
include Included
A = "defined locally"
search = (Module.nesting + self.ancestors + Object.ancestors).uniq
puts A
puts B
puts C
puts D
puts E
puts F
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment