Friday, 21 August 2015

What is the parent class of all classes in Ruby?



2.2.2 :001 >  Class.superclass
 => Module
2.2.2 :002 > Module.superclass
 => Object
2.2.2 :003 > Object.superclass
 => BasicObject
2.2.2 :004 > BasicObject.superclass
 => nil

===> "BasicObject" is the parent class of all classes in Ruby.

2.2.2 :001 >  BasicObject.class
 => Class
2.2.2 :002 > Object.class
 => Class
2.2.2 :003 > Module.class
 => Class
2.2.2 :004 > Class.class
 => Class 

No comments:

Post a Comment