These public methods are in the
Object class, the base class for Ruby. This documentation is adapted and abbreviated from http://www.ruby-doc.org/core/classes/Object.html, where you can find code examples and longer explanations.
Object includes the
Kernel module, whose methods are listed in the next section.
Object Instance Methods
otherare the same object. Typically, this method is overridden in descendant classes to provide class-specific meaning. Unlike
equal?method should never be overridden by subclasses: it is used to determine object identity (that is,
a.equal?(b)if and only if
ais the same object as
otherhave the same value.
Object, effectively the same as calling
==, but typically overridden by descendants to provide meaningful semantics in case statements.
Overridden by descendants (notably
String) to provide meaningful pattern-match semantics.
._ _id_ _
Returns an integer identifier for
obj. The same number will be returned on all calls to
idfor a given object, and no two active objects will share an
Object#object_idis a different concept from the
:namenotation, which returns the symbol
name. Replaces the deprecated
Returns the class of
obj, now preferred over
Object#type, because an object’s type in ...