Object

Object is the default root of all Ruby objects.
Object inherits from BasicObject which allows creating alternate
object hierarchies. Methods on object are available to all classes unless
explicitly overridden.

Object mixes in the Kernel module, making the built-in kernel functions
globally accessible. Although the instance methods of Object are defined by the Kernel module, we have chosen to document them here
for clarity.

When referencing constants in classes inheriting from Object you do not need to use the full namespace.
For example, referencing File inside YourClass
will find the top-level File class.

In the descriptions of Object's methods, the parameter symbol
refers to a symbol, which is either a quoted string or a Symbol (such as :name).

Your implementation of <=> should return one of the following values:
-1, 0, 1 or nil. -1 means self is smaller than other. 0 means self is equal
to other. 1 means self is bigger than other. Nil means the two values could
not be compared.

When you define <=>, you can include Comparable to gain the methods <=, <,

In general, clone and dup may have different
semantics in descendant classes. While clone is used to
duplicate an object, including its internal state, dup
typically uses the class of the descendant object to create the new
instance.

When using dup any modules that the
object has been extended with will not be copied.

The eql? method returns true if obj
and other refer to the same hash key. This is used by Hash to test members for equality. For objects of
class Object, eql? is synonymous with
==. Subclasses normally continue this tradition by aliasing
eql? to their overridden == method, but there are
exceptions. Numeric types, for example, perform type
conversion across ==, but not across eql?, so:

Generates a Fixnum hash value for this object.
This function must have the property that a.eql?(b) implies
a.hash == b.hash.

The hash value is used along with eql? by the Hash class to determine if two objects reference the
same hash key. Any hash value that exceeds the capacity of a Fixnum will be truncated before being used.

The hash value for an object may not be identical across invocations or
implementations of ruby. If you need a stable identifier across ruby
invocations and implementations you will need to generate one with a custom
method.

Returns a string containing a human-readable representation of
obj. By default, show the class name and the list of the instance
variables and their values (by calling inspect on each of them). User
defined classes should override this method to make better representation
of obj. When overriding this method, it should return a string
whose encoding is compatible with the default external encoding.

Returns the value of the given instance variable, or nil if the instance
variable is not set. The @ part of the variable name should be
included for regular instance variables. Throws a NameError
exception if the supplied symbol is not valid as an instance variable name.
String arguments are converted to symbols.

Sets the instance variable names by symbol to object,
thereby frustrating the efforts of the class's author to attempt to
provide proper encapsulation. The variable did not have to exist prior to
this call. If the instance variable name is passed as a string, that string
is converted to a symbol.

Looks up the named method as a receiver in obj, returning a
Method object (or raising NameError). The
Method object acts as a closure in obj's object
instance, so instance variables and the value of self remain
available.

Returns a list of the names of public and protected methods of
obj. This will include all the methods accessible in
obj's ancestors. If the regular parameter is set to
false, Returns an array of obj's public and protected
singleton methods, the array will not include methods in modules included
in obj.

Invokes the method identified by symbol, passing it any arguments
specified. Unlike send, #public_send calls public
methods only. When the method is identified by a string, the string is
converted to a symbol.

Invokes the method identified by symbol, passing it any arguments
specified. You can use __send__ if the name send
clashes with an existing method in obj. When the method is
identified by a string, the string is converted to a symbol.

Returns an array of the names of singleton methods for obj. If the
optional all parameter is true, the list will include methods in
modules included in obj. Only public and protected singleton
methods are returned.

Objects that are marked as tainted will be restricted from various built-in
methods. This is to prevent insecure data, such as command-line arguments
or strings read from Kernel#gets,
from inadvertently compromising the users system.

Returns a string representing obj. The default to_s
prints the object's class and an encoding of the object id. As a
special case, the top-level object that is the initial execution context of
Ruby programs returns “main.''