Looking at the Ruby docs, I see that instance methods from class Object
are included from the module Kernel
.
But this line from an article:
The BasicObject class is the parent class of all classes in Ruby. Its methods are therefore available to all objects unless explicitly overridden. Prior to Ruby 1.9, Object class was the root of the class hierarchy. The new class BasicObject serves that purpose, and Object is a subclass of BasicObject. BasicObject is a very simple class, with almost no methods of its own. When you create a class in Ruby, you extend Object unless you explicitly specify the super-class, and most programmers will never need to use or extend BasicObject.
says that making a class is extending class Object
.
My knowledge of extend
is that it will convert the instance methods the module has into methods that can be reached in the same way that class methods are.
Is it implying here that it is technically extending Kernel
rather than including when a class is constructed?
And how does that work if that is the case?