rubyguides

Reference

Core Classes

Reference pages for Ruby core classes and constructors.

  1. BasicObject#method_missing

    Intercept calls to undefined methods. method_missing is called when an object responds to no method by that name — use it to implement dynamic delegation, fl...

  2. Binding

    An object that encapsulates the execution context, including local variables, self, and method scope.

  3. Float

    A numeric class representing IEEE 754 double-precision floating-point numbers.

  4. Integer

    The core class for whole numbers, including Fixnum (smaller) and Bignum (larger) in older Ruby.

  5. Kernel#block_given?

    Returns true if a block was passed to the current method, otherwise returns false.

  6. Object#clone

    Create a shallow copy of an object. clone copies both instance variables and singleton class.

  7. Object#dup

    Create a shallow copy of an object. dup copies instance variables but not singleton methods.

  8. Object#frozen?

    Returns true if the object is frozen (immutable), false otherwise. Frozen objects cannot be modified.

  9. Object#instance_of?

    Returns true if the object is an instance of exactly the given class, not its superclasses.

  10. Object#is_a?

    Checks whether an object is an instance of a given class or any of its superclasses. Returns true or false.

  11. Object#kind_of?

    Returns true if the object is an instance of the given class or any of its superclasses.

  12. Object#nil?

    The nil? method returns true if an object is nil, false otherwise. It's the standard way to check for nil values in Ruby.

  13. Object#object_id

    Returns a unique integer identifier for a Ruby object. This integer is the object's memory address in the MRI implementation.

  14. Object#respond_to?

    Checks whether an object responds to a given method, returning true or false. Essential for duck typing and dynamic method handling in Ruby.

  15. Object#send

    Invokes the named method on the object, passing any arguments. send is the foundation for dynamic method calls in Ruby.

  16. Object#tap

    Yields the object to a block and returns the object itself, useful for debugging or method chaining.

  17. Object#try

    Safely call a method on an object if it responds to it, returns nil otherwise

  18. String#chomp!

    Removes trailing record separators from a string in-place. Modifies the original string.