views:

21

answers:

1

Example

def Object.const_missing(name)
  puts self.class
end
class A; end
A::B # => Class

How can I get A in Object#const_missing?

+3  A: 
def Object.const_missing(name)
  puts self
end
Justice
Hehe, embarrassing... Thank you!
Andrey