About the Kernel module

I was wondering why puts, which I use casually, can be used, so I looked it up.

** In conclusion, one Kernel module was biting. ** **

Methods provided by the Kernel module


puts
p
print
require
gets

It seems that the above methods are defined in the Kernel module.

Classes such as String, Numeric, Array, and Hash all seem to inherit from the Object class.

Confirm parent class


$ rails c

>> String.superclass
=> Object
>> Numeric.superclass
=> Object
>> Array.superclass
=> Object
>> Hash.superclass
=> Object

Originally, ** the Object class (superclass is BasicObject), which is almost all parent classes, includes the Kernel module **, so It seems that you can use any class by default without thinking about the puts method.

Below is a list of specific methods defined in the Kernel module.

module Kernel

Recommended Posts

About the Kernel module
About Ruby Kernel Module
About the method
About the package
Output about the method # 2
Commentary: About the interface
About the function double-java
About the ternary operator
About the length method
About the authenticate method.
About the map method
About the ancestors method
[Output] About the database
About the [ruby] operator
About the to_s method.
About specifying the JAXRS path
Output about the method Part 1
about the where method (rails)
A note about the scope
About the description of Docker-compose.yml
About the File :: Stat class
About the same and equivalent
About the Android life cycle
About the explanation about functional type
About the programming language Crystal
Consideration about the times method
About the behavior of ruby Hash # ==
About the language to be learned
About the basics of Android development
About the equals () and hashcode () methods
About the symbol <%%> in Rails erb
About the information sharing app band
About the current development environment (Java 8)
A murmur about the utility class
About the role of the initialize method
Think about the 7 rules of Optional
About =
Summary about the introduction of Device
About the log level of java.util.logging.Logger
Guess about the 2017 Java Persistence Framework (3) Reladomo
Check once again about the OpenSSL command
What is testing? ・ About the importance of testing
About the procedure for java to work
About the new Java release model @ Seki Java (2018/07/20)
About the operation of next () and nextLine ()
About the initial display of Spring Framework
About the error message Invalid redeclaration of'***'
About the treatment of BigDecimal (with reflection)
About the difference between irb and pry
[Japanese version Faker] About the gem "gimei"
About the number of threads of Completable Future
About the mechanism of the Web and HTTP