CrackedRuby
✕
CrackedRuby
Launch App
Ruby Language Docs
CS Fundamentals
Home
→
Ruby Language Documentation
Ruby Language Documentation
Jump to section...
Ruby Language Fundamentals
Core Built-in Classes
Core Modules
Standard Library
Metaprogramming
Concurrency and Parallelism
Performance Optimization
Testing and Quality
Development Tools
Ruby 3.4 Specific Features
Patterns and Best Practices
Ecosystem Integration
Ruby Language Fundamentals
Basic Syntax and Structure
1.1.1
Character Sets
1.1.2
Line Orientation and Statement Termination
1.1.3
Code Blocks
1.1.4
Embedded Documentation (=begin/=end)
1.1.5
Reserved Keywords and Identifiers
1.1.6
Language Encoding and Magic Comments
1.1.7
Comments
1.1.8
Indentation
Variables and Constants
1.2.1
Local Variables
1.2.2
Instance Variables (@variable)
1.2.3
Class Variables (@@variable)
1.2.4
Global Variables ($variable)
1.2.5
Constants and Namespacing
1.2.6
Pseudo Variables (self, nil, true, false)
1.2.7
Variable Scope and Binding
1.2.8
Parallel Assignment
1.2.9
Splat Operators in Assignment
Data Types and Literals
1.3.1
Numeric Literals (Integer, Float, Binary, Octal, Hex)
1.3.2
String Literals
1.3.3
Symbol Literals
1.3.4
Array Literals
1.3.5
Hash Literals
1.3.6
Range Literals
1.3.7
Regular Expression Literals
1.3.8
Here Documents
1.3.9
Percent Notation
1.3.10
String Interpolation
Operators
1.4.1
Arithmetic Operators
1.4.2
Comparison and Equality Operators
1.4.3
Logical Operators (and/or vs &&/||)
1.4.4
Bitwise Operators
1.4.5
Range Operators
1.4.6
Assignment Operators
1.4.7
Splat and Double Splat Operators
1.4.8
Safe Navigation Operator (&.)
1.4.9
Pattern Matching Operators
1.4.10
Operator Precedence and Associativity
1.4.11
Rightward Assignment Operator (=>)
Control Flow
1.5.1
if/elsif/else Statements
1.5.2
unless Statements
1.5.3
case/when Expressions
1.5.4
Modifier if and unless
1.5.5
Ternary Operator
1.5.6
Pattern Matching with case/in
1.5.7
Pattern Matching in Depth
1.5.8
Pattern Matching with Find Patterns
1.5.9
Pin Operator in Pattern Matching
Loops and Iterators
1.6.1
while and until Loops
1.6.2
for Loops
1.6.3
loop Method
1.6.4
times, upto, downto Methods
1.6.5
each and Enumerator Methods
1.6.6
break, next, redo, retry
1.6.7
Infinite Loops and Loop Control
Methods
1.7.1
Method Definition and Syntax
1.7.2
Required and Optional Parameters
1.7.3
Default Parameter Values
1.7.4
Variable Arguments (*args)
1.7.5
Keyword Arguments
1.7.6
Block Parameters (&block)
1.7.7
Method Return Values
1.7.8
Method Visibility (public, protected, private)
1.7.9
Method Aliases and Undef
1.7.10
Operator Methods
1.7.11
Endless Method Definition
1.7.12
Method Definition Styles Comparison
Blocks, Procs, and Lambdas
1.8.1
Block Syntax and Usage
1.8.2
Block Parameters and Return Values
1.8.3
yield and block_given?
1.8.4
Proc Objects
1.8.5
Lambda Functions
1.8.6
Proc vs Lambda Differences
1.8.7
Closures and Lexical Scope
1.8.8
Block to Proc Conversion
1.8.9
Currying and Partial Application
1.8.10
Numbered Block Parameters (_1, _2)
1.8.11
Anonymous Block Arguments Best Practices
Classes and Objects
1.9.1
Class Definition and Instantiation
1.9.2
Instance Variables and Methods
1.9.3
Class Variables and Methods
1.9.4
Constructors (initialize)
1.9.5
Inheritance and super
1.9.6
Method Overriding
1.9.7
Access Control
1.9.8
attr_accessor, attr_reader, attr_writer
1.9.9
Class Constants
1.9.10
Class Instance Variables
Modules and Mixins
1.10.1
Module Definition
1.10.2
Module Methods
1.10.3
include Method
1.10.4
extend Method
1.10.5
prepend Method
1.10.6
Module Constants
1.10.7
Namespacing with Modules
1.10.8
Method Lookup Chain
1.10.9
Module Functions
1.10.10
Refinements
1.10.11
Nesting Behavior
Exception Handling
1.11.1
begin/rescue/ensure/end
1.11.2
raise and fail
1.11.3
Exception Classes Hierarchy
1.11.4
Custom Exception Classes
1.11.5
rescue Modifiers
1.11.6
retry and Exception Handling
1.11.7
throw and catch
1.11.8
Exception Backtrace
Core Built-in Classes
Numeric Classes
2.1.1
Integer Class and Methods
2.1.2
Float Class and Precision
2.1.3
Rational Numbers
2.1.4
Complex Numbers
2.1.5
Numeric Base Class
2.1.6
BigDecimal for Arbitrary Precision
2.1.7
Numeric Coercion
2.1.8
Mathematical Operations
String Class
2.2.1
String Creation and Literals
2.2.2
String Concatenation
2.2.3
String Comparison
2.2.4
String Searching and Matching
2.2.5
String Substitution (sub, gsub)
2.2.6
String Splitting and Joining
2.2.7
String Case Conversion
2.2.8
String Encoding
2.2.9
String Formatting
2.2.10
String Iteration
2.2.11
String Freezing and Mutability
Symbol Class
2.3.1
Symbol Creation and Usage
2.3.2
Symbol vs String
2.3.3
Symbol Methods
2.3.4
Symbol to Proc
Array Class
2.4.1
Array Creation and Initialization
2.4.2
Array Access and Assignment
2.4.3
Array Iteration Methods
2.4.4
Array Transformation (map, select, reject)
2.4.5
Array Sorting and Ordering
2.4.6
Array Set Operations
2.4.7
Array Flattening and Transposition
2.4.8
Array Compaction
2.4.9
Array fetch_values
2.4.10
Array Destructuring
2.4.11
Array Uniqueness
Hash Class
2.5.1
Hash Creation and Initialization
2.5.2
Hash Access and Assignment
2.5.3
Hash Iteration
2.5.4
Hash Merging and Updating
2.5.5
Hash Transformation
2.5.6
Hash Default Values
2.5.7
Hash Compaction
2.5.8
Hash to Proc
2.5.9
Hash Capacity
2.5.10
Hash Value Omission
2.5.11
Hash Shorthand Syntax
Range Class
2.6.1
Range Creation (Inclusive/Exclusive)
2.6.2
Range Iteration
2.6.3
Range Testing (cover?, include?)
2.6.4
Range to Array Conversion
2.6.5
Endless and Beginless Ranges
2.6.6
Range step with Custom Objects
Regexp and MatchData
2.7.1
Regular Expression Syntax
2.7.2
Pattern Matching Methods
2.7.3
Capture Groups
2.7.4
Named Captures
2.7.5
Regexp Options and Modifiers
2.7.6
MatchData Methods
2.7.7
bytebegin and byteend
2.7.8
Regexp Timeout
Time and Date Classes
2.8.1
Time Class and Creation
2.8.2
Time Arithmetic
2.8.3
Time Formatting (strftime)
2.8.4
Time Parsing
2.8.5
Time Zones
2.8.6
Date Class
2.8.7
DateTime Class
2.8.8
xmlschema and iso8601
File and IO Classes
2.9.1
File Operations
2.9.2
File Reading and Writing
2.9.3
File Permissions
2.9.4
IO Class Methods
2.9.5
STDIN, STDOUT, STDERR
2.9.6
Dir Class
2.9.7
Pathname Class
2.9.8
File.stat and File Testing
Process and System
2.10.1
Process Creation and Management
2.10.2
Process Communication
2.10.3
Signal Handling
2.10.4
System Calls
Data Class
2.11.1
Data Class Introduction
2.11.2
Data vs Struct Comparison
2.11.3
Data Class Pattern Matching
Core Modules
Kernel Module
3.1.1
Global Functions
3.1.2
Type Conversion Methods
3.1.3
Output Methods (puts, print, p)
3.1.4
Input Methods (gets, readline)
3.1.5
Program Termination
3.1.6
eval and Binding
3.1.7
require and load
3.1.8
autoload
Enumerable Module
3.2.1
Iteration Methods
3.2.2
Searching and Filtering
3.2.3
Transformation Methods
3.2.4
Aggregation Methods
3.2.5
Grouping and Partitioning
3.2.6
Enumerator Class
3.2.7
External Iteration
Comparable Module
3.3.1
Spaceship Operator (<=>)
3.3.2
Comparison Methods
3.3.3
between? Method
3.3.4
clamp Method
Math Module
3.4.1
Trigonometric Functions
3.4.2
Logarithmic Functions
3.4.3
Constants (PI, E)
3.4.4
Square Root and Power
3.4.5
Hyperbolic Functions
ObjectSpace Module
3.5.1
Object Enumeration
3.5.2
Memory Management
3.5.3
Finalizers
3.5.4
Object Counting
GC Module
3.6.1
Garbage Collection Control
3.6.2
GC Statistics
3.6.3
GC Compaction
3.6.4
GC Configuration
3.6.5
Modular GC
Marshal Module
3.7.1
Object Serialization
3.7.2
dump and load Methods
3.7.3
Custom Marshaling
Signal Module
3.8.1
Signal Trapping
3.8.2
Signal Lists
Standard Library
Data Structures
4.1.1
Set and SortedSet
4.1.2
Queue and SizedQueue
4.1.3
Stack Implementation
4.1.4
OpenStruct
4.1.5
Struct Class
Network Programming
4.2.1
Net::HTTP
4.2.2
Net::FTP
4.2.3
Net::SMTP
4.2.4
Net::POP3
4.2.5
Net::IMAP
4.2.6
Socket Programming
4.2.7
TCPSocket and UDPSocket
4.2.8
URI Module
4.2.9
OpenURI
4.2.10
Happy Eyeballs v2
Data Formats
4.3.1
JSON Parsing and Generation
4.3.2
YAML Processing
4.3.3
CSV Reading and Writing
4.3.4
XML/REXML
4.3.5
RSS/Atom Feeds
4.3.6
Base64 Encoding
Database Interfaces
4.4.1
PStore
4.4.2
DBM
4.4.3
GDBM
4.4.4
SDBM
Security and Cryptography
4.5.1
OpenSSL
4.5.2
Digest Algorithms
4.5.3
SecureRandom
4.5.4
HMAC
4.5.5
Public Key Cryptography
4.5.6
SSL/TLS
File Utilities
4.6.1
FileUtils
4.6.2
Find Module
4.6.3
Tempfile
4.6.4
Pathname
4.6.5
FileTest
Text Processing
4.7.1
StringIO
4.7.2
StringScanner
4.7.3
ERB Templates
4.7.4
Scanf
4.7.5
Format Strings
System Utilities
4.8.1
OptionParser
4.8.2
Logger
4.8.3
Syslog
4.8.4
Etc Module
4.8.5
GetoptLong
4.8.6
Shellwords
Web and CGI
4.9.1
CGI Module
4.9.2
WEBrick Server
4.9.3
CGI Sessions
4.9.4
CGI Cookies
Compression
4.10.1
Zlib
4.10.2
GZip
4.10.3
Tar Archives
Debugging Tools
4.11.1
Debug Gem
4.11.2
Tracer
4.11.3
Profile
4.11.4
Debugger API
4.11.5
Debug Gem Commands
4.11.6
Remote Debugging with Debug Gem
4.11.7
Debug Gem Configuration
Date and Time Extensions
4.12.1
Date Calculations
4.12.2
Chronic Duration
Internationalization
4.13.1
Encoding Classes
4.13.2
Encoding Conversion
4.13.3
Unicode Support
Metaprogramming
Reflection and Introspection
5.1.1
Object Inspection Methods
5.1.2
Class and Module Queries
5.1.3
Method Queries
5.1.4
respond_to? and respond_to_missing?
5.1.5
Instance Variable Access
5.1.6
Constant Queries
Dynamic Method Definition
5.2.1
define_method
5.2.2
method_missing
5.2.3
const_missing
5.2.4
Dynamic Attribute Methods
5.2.5
Method Delegation
Hooks and Callbacks
5.3.1
included and extended
5.3.2
inherited
5.3.3
method_added
5.3.4
method_removed
5.3.5
method_undefined
Evaluation Methods
5.4.1
eval
5.4.2
instance_eval
5.4.3
class_eval and module_eval
5.4.4
instance_exec
5.4.5
Binding Objects
Singleton Classes
5.5.1
Eigenclass Concept
5.5.2
Singleton Methods
5.5.3
Class Methods as Singleton Methods
5.5.4
extend vs include
Method Objects
5.6.1
Method Class
5.6.2
UnboundMethod Class
5.6.3
Method Binding
5.6.4
Method Parameters
5.6.5
super_method
DSL Creation
5.7.1
DSL Design Patterns
5.7.2
Method Chaining DSLs
5.7.3
Block-based DSLs
5.7.4
Class Macros
Code Generation
5.8.1
Dynamic Class Creation
5.8.2
Dynamic Module Creation
5.8.3
Runtime Code Modification
Monkey Patching
5.9.1
Core Class Extensions
5.9.2
prepend for Method Interception
TracePoint API
5.10.1
Event Tracing
5.10.2
Method Call Tracking
5.10.3
Exception Tracking
Concurrency and Parallelism
Threading
6.1.1
Thread Creation and Management
6.1.2
Thread Safety
6.1.3
Thread Local Variables
6.1.4
Thread Groups
6.1.5
Global VM Lock (GVL)
Ractors
6.2.1
Ractor Creation
6.2.2
Message Passing
6.2.3
Shareable Objects
6.2.4
Ractor-local Storage
6.2.5
Ractor.main?
Fibers
6.3.1
Fiber Creation
6.3.2
Fiber Scheduling
6.3.3
Fiber Resume and Yield
6.3.4
Fiber Scheduler
6.3.5
Building Custom Fiber Schedulers
6.3.6
Fiber Scheduler with IO Operations
6.3.7
Fiber Scheduler Performance
Synchronization
6.4.1
Mutex
6.4.2
Monitor
6.4.3
ConditionVariable
6.4.4
Barrier Synchronization
Process-based Parallelism
6.5.1
fork and Process Management
6.5.2
spawn and exec
6.5.3
Process Pools
Async I/O
6.6.1
Non-blocking I/O
6.6.2
Event Loops
6.6.3
Async Gem
6.6.4
Fiber Scheduler Interface
Thread Pools
6.7.1
Thread Pool Patterns
6.7.2
Work Queues
6.7.3
Worker Threads
Performance Optimization
YJIT Compiler
7.1.1
YJIT Configuration
7.1.2
YJIT Memory Management
7.1.3
YJIT Statistics
7.1.4
YJIT Logging
7.1.5
Register Allocation
Memory Management
7.2.1
Garbage Collection Tuning
7.2.2
Object Allocation
7.2.3
Memory Profiling
7.2.4
Heap Compaction
Profiling Tools
7.3.1
ruby-prof
7.3.2
stackprof
7.3.3
memory_profiler
7.3.4
benchmark-ips
Optimization Techniques
7.4.1
Algorithm Optimization
7.4.2
Caching Strategies
7.4.3
Lazy Evaluation
7.4.4
Object Pooling
C Extensions and FFI
7.5.1
Writing C Extensions
7.5.2
Foreign Function Interface
7.5.3
Memory View API
7.5.4
Native Extension Best Practices
Testing and Quality
Testing Frameworks
8.1.1
RSpec
8.1.2
MiniTest
8.1.3
Test::Unit
8.1.4
Cucumber
Test Patterns
8.2.1
Test Fixtures
8.2.2
Test Factories
Code Quality Tools
8.3.1
RuboCop
8.3.2
Reek
8.3.3
SimpleCov
8.3.4
Brakeman
Documentation
8.4.1
YARD
8.4.2
RDoc
8.4.3
Documentation Best Practices
Development Tools
REPL Environments
9.1.1
IRB
9.1.2
Pry
9.1.3
REPL Configuration
Package Management
9.2.1
RubyGems
9.2.2
Bundler
9.2.3
Gem Creation
9.2.4
Private Gem Servers
Version Management
9.3.1
rbenv
9.3.2
RVM
9.3.3
chruby
9.3.4
asdf
Build Tools
9.4.1
Rake
9.4.2
Make Integration
9.4.3
Asset Pipeline
Debugging
9.5.1
byebug
9.5.2
pry-byebug
Environment Management
9.6.1
dotenv
9.6.2
Environment Variables
9.6.3
Configuration Management
Ruby 3.4 Specific Features
The "it" Parameter
10.1.1
it Parameter Fundamentals
10.1.2
it Parameter vs Numbered Parameter
Prism Parser
10.2.1
Parser Architecture
10.2.2
Migration from parse.y
10.2.3
Parser Selection
String Enhancements
10.3.1
append_as_bytes Method
10.3.2
Float Parsing Improvements
10.3.3
Frozen String Literal Warnings
Hash Improvements
10.4.1
Capacity Parameter
10.4.2
Modern Inspect Format
Range Enhancements
10.5.1
step with + Operator
10.5.2
size TypeError for Non-iterable
Exception Improvements
10.6.1
Backtrace Locations
10.6.2
Error Message Format
10.6.3
set_backtrace Enhancement
Ractor Enhancements
10.7.1
require in Ractors
10.7.2
store_if_absent
YJIT Improvements
10.8.1
Performance Gains
10.8.2
Memory Optimization
10.8.3
YJIT New Configuration Options
Warning System
10.9.1
Warning Categories
10.9.2
Strict Unused Block
Breaking Changes
10.10.1
Index Assignment Restrictions
10.10.2
**nil Keyword Splatting
10.10.3
Reserved ::Ruby Constant
Patterns and Best Practices
Ruby Idioms
11.1.1
Duck Typing
11.1.2
Null Object Pattern
Code Organization
11.2.1
Module Structure
11.2.2
Namespace Design
11.2.3
Service Objects
11.2.4
Value Objects
Error Handling
11.3.1
Exception Design
11.3.2
Fail Fast Principle
11.3.3
Error Recovery
Performance Patterns
11.4.1
Eager Loading
11.4.2
Database Optimization
Coding Standards
11.5.1
Ruby Style Guide
11.5.2
Naming Conventions
11.5.3
Testing Standards
Ecosystem Integration
Web Frameworks
12.1.1
Rails Integration
12.1.2
Sinatra Integration
12.1.3
Hanami Integration
Database Libraries
12.2.1
ActiveRecord
12.2.2
Sequel
12.2.3
ROM
Background Jobs
12.3.1
Sidekiq
12.3.2
Resque
12.3.3
Delayed Job
API Development
12.4.1
REST APIs
12.4.2
GraphQL
12.4.3
JSON:API
Deployment
12.5.1
Capistrano
12.5.2
Docker
12.5.3
Kubernetes
Monitoring
12.6.1
Application Monitoring
12.6.2
Performance Monitoring