
What was yielded by method becomes values of enumerator. The Binding of the top level scope Public Instance MethodsĬreates a new Enumerator which will enumerate by calling method on obj, passing args if any. Holds the original stdout TOPLEVEL_BINDING When a Hash is assigned to SCRIPT_LINES_ the contents of files loaded after the assignment will be added as an Array of lines with the file name as the key. The running version of ruby SCRIPT_LINES_ The date this ruby was released RUBY_REVISION The platform for this ruby RUBY_RELEASE_DATE If this is a development build of ruby the patchlevel will be -1 RUBY_PLATFORM The version of the engine or interpreter this ruby uses. The engine or interpreter this ruby uses.
#BOOSTNOTE RUBY GLOBAL VARIABLE FULL#
The full ruby version string, like ruby -v prints RUBY_ENGINE The copyright string for ruby RUBY_DESCRIPTION To create a data section use _END_: $ cat t.rbĮNV is a Hash-like accessor for environment variables. DATAĭATA is a File that contains the data section of the executed file. ARGVĪRGV contains the command line arguments used to run ruby.Ī library like OptionParser can be used to process command-line arguments. To_s: Returns a string representation of self.ĪRGF is a stream designed for use in scripts that process files given as command-line arguments or passed in via STDIN. Method_missing: Method called when an undefined method is called on self. Inspect: Returns a human-readable string representation of self. Hash: Returns the integer hash value for self. Remove_instance_variable: Removes the named instance variable from self.Ĭlone: Returns a shallow copy of self, including singleton class and frozen state.ĭisplay: Prints self to the given IO stream or $stdout.ĭup: Returns a shallow unfrozen copy of self.Įnum_for (aliased as to_enum): Returns an Enumerator for self using the using the given method, arguments, and block.įreeze: Prevents further modifications to self. Instance_variables: Returns an array of the symbol names of the instance variables in self. Instance_variable_set: Sets the value of the given instance variable in self to the given object. Instance_variable_get: Returns the value of the given instance variable in self, or nil if the instance variable is not set. Send: Calls the given method in self with the given argument. Public_send: Calls the given public method in self with the given argument. Singleton_methods: Returns an array of the symbol names of the singleton methods in self.ĭefine_singleton_method: Defines a singleton method in self for the given symbol method-name and block or proc.Įxtend: Includes the given modules in the singleton class of self. Singleton_method: Returns the Method object for the given singleton method in self. Singleton_class: Returns the singleton class of self. Respond_to?: Returns whether self responds to the given method. Public_methods: Returns an array of the symbol names of the public methods in self. Public_method: Returns the Method object for the given public method in self. Protected_methods: Returns an array of the symbol names of the protected methods in self. Private_methods: Returns an array of the symbol names of the private methods in self. Object_id: Returns an integer corresponding to self that is unique for the current process Methods: Returns an array of symbol names of public and protected methods in self. Method: Returns the Method object for the given method in self. Instance_variable_defined?: Returns whether the given instance variable is defined in self. Instance_of?: Returns whether self is an instance of the given class. Kind_of? (aliased as is_a?): Returns whether given argument is an ancestor of the singleton class of self. =: Implements case equality, effectively the same as calling =.Įql?: Implements hash equality, effectively the same as calling =.

#: Returns 0 if self and the given object object are the same object, or if self = object otherwise returns nil. #!~: Returns true if self does not match the given object, otherwise false. 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). For example, referencing File inside YourClass will find the top-level File class.

When referencing constants in classes inheriting from Object you do not need to use the full namespace. Although the instance methods of Object are defined by the Kernel module, we have chosen to document them here for clarity. Object mixes in the Kernel module, making the built-in kernel functions globally accessible. Methods on Object are available to all classes unless explicitly overridden. Object inherits from BasicObject which allows creating alternate object hierarchies. Object is the default root of all Ruby objects.
