A
ako...
hello,
module M
class C
def c() puts 'c' end
end
end
module M
class C
def c() puts 'cc' end
end
end
M::C.new.c
produces the same output as
module M
class C
def c() puts 'c' end
end
end
class M::C
def c() puts 'cc' end
end
M::C.new.c
does anyone know what the difference is between reopening a module and
then reopening a class in it as in the first code fragment and just
reopening a class defined in a module as in the second fragment?
as far as i can tell there is some difference because my real code
which is more complicated than the above works in case when i reopen
M::C and does not work in case when i reopen M and then reopen C.
thanks
konstantin
module M
class C
def c() puts 'c' end
end
end
module M
class C
def c() puts 'cc' end
end
end
M::C.new.c
produces the same output as
module M
class C
def c() puts 'c' end
end
end
class M::C
def c() puts 'cc' end
end
M::C.new.c
does anyone know what the difference is between reopening a module and
then reopening a class in it as in the first code fragment and just
reopening a class defined in a module as in the second fragment?
as far as i can tell there is some difference because my real code
which is more complicated than the above works in case when i reopen
M::C and does not work in case when i reopen M and then reopen C.
thanks
konstantin