Arun Agrawal’s Blog

Ruby on Rails Developer

BasicObject Introduced in Ruby 1.9

RUBY_VERSION < 1.9
class Parent
end
class Child < Parent
end

puts Child.superclass   #=> Parent
puts Parent.superclass  #=> Object
puts Parent.superclass.superclass  #=> nil
RUBY_VERSION = 1.9
class Parent
end
class Child < Parent
end 

puts Child.superclass   #=> Parent
puts Parent.superclass  #=> Object
puts Parent.superclass.superclass  #=> BasicObject
puts Parent.superclass.superclass.superclass  #=> nil
So now given any class in Ruby, super class will be BasicObject for newer versions.