Skip to content
documentation

Ruby 4.0

1,246 classes and modules
11,536 methods
Other versions: 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0
recent

Text and data

String Mutable sequence of bytes with an encoding. Slicing, substitution, case, and Unicode. 137 instance methods, 3 class methods JSON Parse and generate JSON. Ships as a default gem. 10 instance methods, 5 class methods Regexp Regular-expression patterns. Match data, named captures, and flags. 20 instance methods, 11 class methods Symbol Immutable, interned names. One object per spelling. 31 instance methods, 2 class methods

Collections

Array Ordered, integer-indexed collection of any objects. 114 instance methods, 3 class methods Hash Ordered key-value map with default values and compare-by-identity. 72 instance methods, 5 class methods Enumerable Mixin that gives any class with each the full set of search, sort, and loop methods. 61 instance methods Range Interval from a start to an end, endless or beginless. 30 instance methods, 2 class methods Set Unordered collection of unique values, backed by Hash. 61 instance methods, 3 class methods

Numbers and time

Integer Arbitrary-precision whole numbers. Bit operations and iteration. 66 instance methods, 2 class methods Date Calendar dates without time. Civil, Julian, and ISO week forms. 68 instance methods, 33 class methods Time Point in time with zone. Parsing, formatting, and arithmetic. 65 instance methods, 16 class methods Float 64-bit floating-point numbers. Rounding, not-a-number, and infinity. 47 instance methods Numeric Base class of every number. Comparison, coercion, and stepping. 46 instance methods

Objects and control

Kernel Global functions every object has: puts, require, raise, loop. 81 instance methods, 3 class methods Object Default root. Equality, inspection, freezing, and message sending. 41 instance methods, 1 class methods BasicObject Blank-slate root above Object. Almost no methods, for proxies and domain-specific languages. 12 instance methods, 1 class methods Class A Module that makes instances. Inheritance, new, and allocate. 6 instance methods, 1 class methods Module Named collection of methods and constants. Mixins, visibility, and reflection. 78 instance methods, 5 class methods Proc Callable block with a binding. Lambdas, currying, and arity. 19 instance methods, 1 class methods Struct Generate a value class with named members in one line. 23 instance methods, 4 class methods

Input and output

Dir Directory listing and globbing. 15 instance methods, 23 class methods File Input and output on a path. Reading, writing, file status, and permissions. 10 instance methods, 63 class methods IO Byte and line streams. Files, pipes, sockets, and the console. 115 instance methods, 16 class methods

Concurrency

Thread Concurrent execution, one thread running Ruby at a time. Queues, mutexes, and thread-local values. 37 instance methods, 19 class methods
Addrinfo The Addrinfo class maps struct addrinfo to ruby. 42 instance methods, 7 class methods ARGF The files named on the command line, read as one stream. 50 instance methods ArgumentError Raised when the arguments are wrong and there isn’t a more specific Exception class. 0 instance methods BasicSocket BasicSocket is the super class for all the Socket classes. 20 instance methods, 3 class methods BigDecimal Arbitrary-precision decimal numbers, from the bigdecimal gem. 2 instance methods, 1 class methods Binding A captured execution context. Local variables, self, and eval. 10 instance methods CGI Since Ruby 4.0, only the escape helpers from CGI::Escape. The rest of CGI left the standard library. 0 instance methods ClosedQueueError The exception class which will be raised when pushing into a closed Queue. 0 instance methods Comparable Mixin that derives the ordering operators from <=>. 7 instance methods Complex Complex numbers in rectangular or polar form. 39 instance methods, 4 class methods Continuation Saved point of execution from Kernel#callcc, after require "continuation". 2 instance methods CoreExtensions Namespace for the RubyGems patches to core classes. 0 instance methods Coverage Coverage provides coverage measurement feature for Ruby. 0 instance methods, 10 class methods Data Immutable value class with named members, defined in one line. 10 instance methods, 3 class methods DateTime A subclass of Date that easily handles date, hour, minute, second, and offset. 22 instance methods, 17 class methods Delegator Base class that passes method calls on to a wrapped object. See SimpleDelegator and DelegateClass. 17 instance methods, 1 class methods DidYouMean The DidYouMean gem adds functionality to suggest possible method/class names upon errors such as NameError and NoMethodError. 0 instance methods, 4 class methods Digest Framework for message digest algorithms such as SHA-256 and MD5. 0 instance methods, 2 class methods Encoding Character encodings and the rules for converting between them. 4 instance methods, 10 class methods EncodingError EncodingError is the base class for encoding errors. 0 instance methods English Include the English library file in a Ruby script, and you can reference the global variables such as $_ using less cryptic names, listed below. 0 instance methods Enumerator A class which allows both internal and external iteration. 14 instance methods, 3 class methods ENV The environment variables of the process, as a Hash-like object. 0 instance methods, 49 class methods EOFError Raised by some IO operations when reaching the end of file. 0 instance methods ERB Class ERB (the name stands for Embedded Ruby ) is an easy-to-use, but also very powerful, template processor. 10 instance methods, 2 class methods Errno One exception class per operating-system error code. 0 instance methods ErrorHighlight Points at the exact expression that failed, under the line in an error message. 0 instance methods, 4 class methods Etc The Etc module provides access to information typically stored in files in the /etc directory on Unix systems. 0 instance methods, 19 class methods Exception Root of the error hierarchy. Backtraces, causes, and messages. 13 instance methods, 4 class methods FalseClass The one false object. 6 instance methods
fatal fatal is an Exception that is raised when Ruby has encountered a fatal error and must exit. 0 instance methods Fcntl Constants from the C header fcntl.h, for IO#fcntl and open(2) flags. 0 instance methods Fiber Cooperative coroutines. Suspend and resume by hand or with a scheduler. 12 instance methods, 11 class methods FiberError Raised for an invalid Fiber operation, such as resuming a dead fiber. 0 instance methods FileTest FileTest implements file test operations similar to those used in File::Stat. 26 instance methods FileUtils Namespace for file utility methods for copying, moving, removing, etc. 47 instance methods, 52 class methods Find The Find module supports the top-down traversal of a set of file paths. 2 instance methods, 2 class methods FloatDomainError Raised when attempting to convert special float values (in particular Infinity or NaN ) to numerical classes which don’t support them. 0 instance methods Forwardable The Forwardable module provides delegation of specified methods to a designated object, using the methods def_delegator and def_delegators. 6 instance methods FrozenError Raised when there is an attempt to modify a frozen object. 1 instance methods, 1 class methods GC Start, tune, and measure the garbage collector. 1 instance methods, 13 class methods Gem RubyGems is the Ruby standard for publishing and managing third party libraries. 0 instance methods, 113 class methods IndexError Raised when the given index is invalid. 0 instance methods Interrupt Raised when the interrupt signal is received, typically because the user has pressed Control-C (on most posix platforms). 0 instance methods IOError Raised when an IO operation fails. 0 instance methods IPAddr IPAddr provides a set of methods to manipulate an IP address. 45 instance methods, 3 class methods IPSocket IPSocket is the super class of TCPSocket and UDPSocket. 4 instance methods, 2 class methods KeyError Raised when the specified key is not found. 2 instance methods, 1 class methods LoadError Raised when a file required (a Ruby script, extension library, …) fails to load. 0 instance methods LocalJumpError Raised when Ruby can’t yield as requested. 2 instance methods MakeMakefile Module MakeMakefile is used by Ruby C extensions to generate a Makefile which will correctly compile and link the C extension to Ruby and a third-party library. 33 instance methods, 4 class methods Marshal Serialize any Ruby object graph to bytes and back. 0 instance methods, 3 class methods MatchData MatchData encapsulates the result of matching a Regexp against string. 27 instance methods Math Trigonometric, logarithmic, and root functions on floats. 0 instance methods, 28 class methods Method A method bound to a receiver. Call it, unbind it, or read its parameters. 23 instance methods Monitor Use the Monitor class when you want to have a lock object for blocks with mutual exclusion. 10 instance methods MonitorMixin In concurrent programming, a monitor is an object or module intended to be used safely by more than one thread. 11 instance methods, 1 class methods NameError Raised when a given name is invalid or undefined. 3 instance methods, 1 class methods Net Namespace for the network protocol clients, such as Net::HTTP. 0 instance methods NilClass The one nil object. Falsy, and converts to empty values. 15 instance methods
CGI::Escape Web-related escape/unescape functionality. 15 instance methods CGI::EscapeExt Fast C versions of the CGI escape and unescape methods. 8 instance methods CoreExtensions::TCPSocketExt RubyGems patch that prepends a faster connect to TCPSocket. 0 instance methods, 1 class methods CoreExtensions::TCPSocketExt::Initializer TCPSocket.new that tries each resolved address and keeps the first to connect. 0 instance methods, 1 class methods Date::Error Raised for an invalid date or time. 0 instance methods DidYouMean::ClassNameChecker Suggests similar constant names for a NameError. 3 instance methods, 1 class methods DidYouMean::ClassNameChecker::ClassName A candidate constant name with its namespace. 1 instance methods, 1 class methods DidYouMean::Correctable Mixin that adds "Did you mean?" suggestions to an error message. 5 instance methods DidYouMean::Formatter The DidYouMean::Formatter is the basic, default formatter for the gem. 1 instance methods, 1 class methods DidYouMean::Jaro Jaro similarity between two strings. 1 instance methods DidYouMean::JaroWinkler Jaro-Winkler similarity, which favours a shared prefix. 1 instance methods DidYouMean::KeyErrorChecker Suggests similar keys for a KeyError. 3 instance methods, 1 class methods DidYouMean::MethodNameChecker Suggests similar method names for a NoMethodError. 3 instance methods, 1 class methods DidYouMean::NameErrorCheckers Picks the checker for a NameError, by constant or by variable name. 0 instance methods, 1 class methods DidYouMean::NullChecker The checker that suggests nothing. 1 instance methods, 1 class methods DidYouMean::PatternKeyNameChecker Suggests similar keys for a NoMatchingPatternKeyError. 3 instance methods, 1 class methods DidYouMean::PlainFormatter The DidYouMean::Formatter is the basic, default formatter for the gem. 1 instance methods, 1 class methods DidYouMean::RequirePathChecker Suggests similar paths for a failed require. 1 instance methods, 2 class methods DidYouMean::SpellChecker Ranks a dictionary of words by distance to a misspelling. 1 instance methods, 1 class methods DidYouMean::TreeSpellChecker Spell checker for a dictionary with a tree structure, such as file paths. 13 instance methods, 1 class methods DidYouMean::VariableNameChecker Suggests similar variable and method names for a NameError. 1 instance methods, 1 class methods DidYouMean::VerboseFormatter The DidYouMean::Formatter is the basic, default formatter for the gem. 1 instance methods, 1 class methods Digest::Base This abstract class provides a common interface to message digest implementation classes written in C. 5 instance methods Digest::Class Base class of the digest algorithm classes. 0 instance methods, 5 class methods Digest::Instance Methods every digest object has: update, digest, and hexdigest. 20 instance methods Digest::MD5 A class for calculating message digests using the MD5 Message-Digest Algorithm by RSA Data Security, Inc., described in RFC1321. 0 instance methods Digest::RMD160 A class for calculating message digests using RIPEMD-160 cryptographic hash function, designed by Hans Dobbertin, Antoon Bosselaers, and Bart Preneel. 0 instance methods Digest::SHA1 SHA-1 message digests. Not safe where collisions matter. 0 instance methods Digest::SHA2 A meta digest provider class for SHA256, SHA384 and SHA512. 5 instance methods, 1 class methods Digest::SHA256 SHA-256 message digests, from the NIST SHA-2 family. 0 instance methods
Digest::SHA384 SHA-384 message digests, from the NIST SHA-2 family. 0 instance methods Digest::SHA512 SHA-512 message digests, from the NIST SHA-2 family. 0 instance methods Encoding::CompatibilityError Raised by Encoding and String methods when the source encoding is incompatible with the target encoding. 0 instance methods Encoding::Converter Encoding conversion class. 14 instance methods, 3 class methods Encoding::ConverterNotFoundError Raised by transcoding methods when a named encoding does not correspond with a known converter. 0 instance methods Encoding::InvalidByteSequenceError Raised by Encoding and String methods when the string being transcoded contains a byte invalid for the either the source or target encoding. 7 instance methods Encoding::UndefinedConversionError Raised by Encoding and String methods when a transcoding operation fails. 5 instance methods Enumerator::ArithmeticSequence Enumerator::ArithmeticSequence is a subclass of Enumerator, that is a representation of sequences of numbers with common difference. 13 instance methods Enumerator::Chain Enumerator::Chain is a subclass of Enumerator, which represents a chain of enumerables that works as a single enumerator. 4 instance methods, 1 class methods Enumerator::Generator Runs the block given to Enumerator.new and feeds its values out. 0 instance methods Enumerator::Lazy Enumerator that chains map, select and more without doing work until you ask for values. 48 instance methods, 1 class methods Enumerator::Producer Backs Enumerator.produce, which builds each value from the one before. 0 instance methods Enumerator::Product Enumerator::Product generates a Cartesian product of any number of enumerable objects. 4 instance methods, 1 class methods Enumerator::Yielder The object an Enumerator.new block receives. y << value emits a value. 1 instance methods ERB::DefMethod Defines an ERB template as an instance method of a class. 1 instance methods, 1 class methods ERB::Escape Fast C version of html_escape, for ERB output. 0 instance methods ERB::Util Escape helpers for templates: html_escape (h) and url_encode (u). 2 instance methods, 2 class methods ErrorHighlight::CoreExt Adds the error-highlight snippet to Exception#detailed_message. 3 instance methods ErrorHighlight::DefaultFormatter Formats the snippet and the ^^^^ marker under the failing line. 0 instance methods, 4 class methods ErrorHighlight::Spotter Finds the column span of the failing call in the syntax tree. 36 instance methods, 1 class methods ErrorHighlight::Spotter::NonAscii Internal signal that the line has non-ASCII text, so no span is shown. 0 instance methods Etc::Group Group is a placeholder Struct for user group database on Unix systems. 0 instance methods, 1 class methods Etc::Passwd Passwd is a placeholder Struct for user database on Unix systems. 0 instance methods, 1 class methods Fiber::Scheduler Documents the interface a non-blocking scheduler must have for Fiber.set_scheduler. Not a real class. 18 instance methods File::Constants Module File::Constants defines file-related constants. 0 instance methods File::Stat Objects of class File::Stat encapsulate common status information for File objects. 43 instance methods, 1 class methods FileUtils::DryRun FileUtils methods that print each command but change no files. 0 instance methods FileUtils::NoWrite FileUtils methods that change no files. 0 instance methods FileUtils::Verbose FileUtils methods that print each command before they run it. 0 instance methods Gem::AvailableSet Gem specifications found across sources, ready to resolve into a request set. 16 instance methods, 1 class methods