Skip to content

Instantly share code, notes, and snippets.

@Shinpeim
Created December 28, 2012 05:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shinpeim/4394799 to your computer and use it in GitHub Desktop.
Save Shinpeim/4394799 to your computer and use it in GitHub Desktop.
class A
class B
def self.nyan
"A::B"
end
end
def self.nyan
B.nyan
end
def self.wan
::B.nyan
end
end
class B
def self.nyan
"B"
end
end
p B.nyan # => "B"
p A.nyan # => "A::B"
p A::B.nyan # => "A::B"
p A.wan # => "B"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment