I try to redefine #const_missing but it does not behave as I expect.
def Object.const_missing(sym)
puts "%s.const_missing: %s" % [self, sym]
end
class Test
def Test.const_missing(sym)
puts "%s.const_missing: %s" % [self, sym]
end
# OK: Test.const_missing
Bart
end
Test.new.instance_eval do
# Object.const_missing, why not Test.const_missing?
Bart
end
Test.module_eval do
# Object.const_missing, why not Test.const_missing?
Bart
end
Regards.