Name
Kernel — Module containing built-in functions
Synopsis
Kernel
is the module in which Ruby’s built-in functions are defined as
module functions. Since it’s included in
Object
, Kernel
is indirectly
included in all classes.
Private Instance Methods
Function-like methods are private
methods of Kernel
. Although the following methods
fall into the same category, they are more similar to standard
private instance methods than function-like methods.
remove_instance_variable(
name
)
Removes instance variable specified by
name
.
Instance Methods
o
== other
Determines if the values are equal.
o
=== other
Comparison operator used by
case
statement (compares equality or confirms class membership).o
=~ other
Checks for pattern matches. The definition in
Kernel
calls===
.o
.class
o
.type
Returns the class of the object
o
.o
.clone
Creates a copy of the object
o
(in as far as possible, including singleton methods).o
.display([
out
=$defout])
Prints the object. The output is specified in the argument.
o
.dup
Creates a copy of the object (copying the content).
o
.eql?(
obj
)
Performs a hash comparison. In order for
eql?
to returntrue
, thehash
value of both objects must have equal hash values.o
.equal?(
obj
)
Returns
true
if the two objects are the same.o
.extend(
mod
)
Adds module features (instance methods, etc.) of
mod
to the objecto
.o
.freeze
Freezes the object
o
, preventing further modification.o
.frozen?
Returns
true
if the object is frozen.o
.hash
Creates a hash value for the object
o
. Used together witheql?
when the object ...
Get Ruby in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.