Kernel
The Kernel module is included by class Object, so its methods are available in every Ruby object. One of the reasons for the Kernel module is to allow methods like puts and gets to be available everywhere and even to look like global commands. Kernel methods allow Ruby to still maintain an “everything is an object” semantics. Kernel methods actually use the implicit receivers and could be written as self.puts and self.gets. As a result, Kernel methods are both available everywhere and resolve like any other method.
Since Kernel is mixed into Object, there is no practical difference between a method defined in Kernel and a method defined in Object. Logically, the distinction is that the methods in Object manage the object-oriented semantics ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access