From: Stanley Roberts Date: 2009-02-12T22:11:13+09:00 Subject: Re: Redefine modules? Pit Capitain wrote: > 2009/2/11 Stanley Roberts : >> I am quite new to Ruby and make some experiences with modules and >> classes. (...) > > Stan, maybe the following code will give you some hints: > > module Cucc > puts Cucc.class # => Module > class Cucc; end > puts Cucc.class # => Class > end > > It has to do with the way Ruby resolves the names of constants. > > Regards, > Pit Hi Pit, it's OK, but I still don't understand what is the situation when overriding a module. I have added the class method to check what happens: Cucc::Cucc.x(30) # => 30 Cucc module Cucc class Cucc.x puts Cucc::Cucc # => Class But after the redefinition of the same module (without having the Cucc innerclass) the same lines lead to different outcome: Cucc::Cucc.x(30) # => 30 Redefined Cucc module Cucc.x puts Cucc::Cucc # => Class Can you please explain me this? Thanks in advance --stan-- -- Posted via http://www.ruby-forum.com/.