K
Kyung won Cheon
-- test1.rb --
module M
module MM
class C
end
class D < MM::C
end
class E < MM::C; puts self; end
end
end
# => M::MM::E
-- test2.rb --
module M
module MM
class C
end
class D < MM::C
end
#class E < MM::C; puts self; end
end
end
M::MM.module_eval("class E < MM::C; puts self; end")
# => uninitialized constant M::MM::MM (NameError)
-- test3.rb --
module M
module MM
class C
end
class D < MM::C
end
#class E < MM::C; puts self; end
end
end
M::MM.module_eval("class E < C; puts self; end")
# => M::MM::E
###################
# test2.rb ???
###################
module M
module MM
class C
end
class D < MM::C
end
class E < MM::C; puts self; end
end
end
# => M::MM::E
-- test2.rb --
module M
module MM
class C
end
class D < MM::C
end
#class E < MM::C; puts self; end
end
end
M::MM.module_eval("class E < MM::C; puts self; end")
# => uninitialized constant M::MM::MM (NameError)
-- test3.rb --
module M
module MM
class C
end
class D < MM::C
end
#class E < MM::C; puts self; end
end
end
M::MM.module_eval("class E < C; puts self; end")
# => M::MM::E
###################
# test2.rb ???
###################