Ruby Newbee wrote:
> Hello,
> 
> irb(main):001:0> class Myclass
> irb(main):002:1>   def play
> irb(main):003:2>   end
> irb(main):004:1> end
> 
> irb(main):027:0> Myclass.class
> => Class
> irb(main):028:0> Myclass.superclass
> => Object
> irb(main):029:0> Class.superclass
> => Module
> 
> 
> Please see the code about, why Myclass.superclass is "Object"? But I
> think it should be "Module".

All classes inherit from Object unless you give a different superclass. 
That is, when you are creating a new class(*),

    class Foo; end

is the same as

    class Foo < Object; end

or

    Foo = Class.new

or

    Foo = Class.new(Object)

HTH,

Brian.

(*) as opposed to re-opening an existing class, which must already have 
had its superclass chosen, and it cannot be changed.
-- 
Posted via http://www.ruby-forum.com/.