Standard Library #

Strings
A complete guide to the String standard library in Ruby — text manipulation, searching and replacing, formatting, type conversion, encoding, and the important methods frequently used in everyday programming.
IO
A complete guide to the IO standard library in Ruby — reading and writing files, file opening modes, buffering, StringIO, directory operations, IO error handling, and idiomatic patterns for safe and efficient file processing.
Math
A complete guide to the Math standard library in Ruby — the Math module, trigonometric functions, logarithms and exponentials, roots and powers, the Numeric and Integer classes, rounding, random numbers with Random, BigDecimal for high precision, and idiomatic mathematical computation patterns.
Enumerable
A complete guide to the Enumerable module in Ruby — collection iteration, data transformation with map and flat_map, filtering with select and reject, aggregation with reduce, sorting, grouping, and lazy enumeration.
Set
A complete guide to the Set module in Ruby's standard library — unique collections without duplicates, set operations like union and intersection, differences from Array, and using SortedSet for ordered data.
Comparable
A complete guide to the Comparable module in Ruby — implementing the spaceship operator, comparing custom objects, automatic sorting, clamp, and integration with Enumerable for sort and min/max.
Pathname
A complete guide to the Pathname class in Ruby's standard library — OOP-style file path manipulation, joining and relative paths, directory iteration, file attribute checks, and its comparison with File and Dir.
FileUtils
A complete guide to the FileUtils module in Ruby's standard library — file and directory operations like copy, move, delete, mkdir, chmod, and safe patterns for filesystem manipulation in Ruby scripts.
JSON
A complete guide to the JSON library in Ruby's standard library — parsing JSON strings, generating JSON from Ruby objects, custom serialization, error handling, and integration with custom classes.
CSV
A complete guide to the CSV library in Ruby's standard library — reading and writing CSV files, customizing separators and encoding, automatic type conversion, efficient iteration over large rows, and integration with custom classes.
URI
A complete guide to the URI module in Ruby's standard library — parsing URLs, accessing host and path components, building URLs programmatically, encoding and decoding, and URI format validation.
Net::HTTP
A complete guide to Net::HTTP in Ruby's standard library — making GET and POST HTTP requests, handling HTTPS, customizing headers and timeouts, file uploads, and proper response handling.
Tempfile
A complete guide to the Tempfile class in Ruby's standard library — creating safe temporary files, lifecycle management, use in testing, atomic write patterns, and integration with Pathname and IO.
Benchmark
A complete guide to the Benchmark module in Ruby's standard library — measuring code execution time, comparing the performance of several implementations with bm and bmbm, interpreting results, and valid benchmarking patterns.
About | Author | Content Scope | Editorial Policy | Privacy Policy | Disclaimer | Contact