Guides

In-depth tutorials and guides for Ruby developers.

WebSockets in Ruby

Build real-time features in Ruby with three WebSocket approaches: websocket-ruby for pure Ruby, ActionCable for Rails, and async-websocket.

min read · intermediate · ruby

The Command Pattern in Ruby

Implement the command pattern in Ruby — encapsulate requests as objects, enable undo/redo, queue operations, and build extensible CLI apps.

min read · intermediate · ruby

The Builder Pattern in Ruby

Learn how to implement the builder pattern in Ruby for cleaner, step-by-step object construction with fluent interfaces and nested structures.

min read · intermediate · ruby

Ruby Array Methods: The Practical Guide

Learn the 7 Ruby array methods you'll use every day—map, select, reduce, find, sort_by, uniq, and flatten—with practical patterns and real examples.

12 min read · beginner · ruby

ActiveSupport Outside of Rails

A practical guide to using ActiveSupport core extensions, time utilities, and number helpers in plain Ruby scripts and gems

10 min read · intermediate · ruby

Configuration Patterns in Ruby

Learn how to design and manage configuration for Ruby applications using patterns like module-level config, Config objects, ENV variables, and YAML files

14 min read · intermediate · ruby

Date and Time in Ruby

A practical guide to working with dates, times, and timestamps in Ruby using the standard library

12 min read · beginner · ruby

The Decorator Pattern in Ruby

Learn how to extend Ruby objects at runtime using the decorator pattern, SimpleDelegator, Forwardable, and ActiveSupport::Notification.

min read · intermediate · ruby

Dependency Injection in Ruby

Learn how dependency injection improves testability and flexibility in Ruby applications through constructor, setter, and method injection patterns.

12 min read · intermediate · ruby

Hash Tricks in Ruby

Essential Hash tricks in Ruby — transform_keys, dig, fetch, slice, auto-vivification, and more.

min read · intermediate · ruby

HTTP Clients in Ruby

A practical guide to making HTTP requests in Ruby using Net::HTTP, Faraday, and HTTParty. Compare approaches, handle errors, and choose the right tool.

14 min read · intermediate · stdlib

JSON and XML in Ruby

Learn how to parse, generate, and manipulate JSON and XML data in Ruby with practical examples and performance tips

12 min read · intermediate · ruby

Logging in Ruby

Learn how to log messages in Ruby using the built-in Logger class, including log levels, formatting, file rotation, and best practices.

min read · beginner · stdlib

The Null Object Pattern in Ruby

The Null Object pattern eliminates nil checks by providing objects that respond to the same interface as real ones, with practical Ruby and Rails examples.

min read · intermediate · ruby

The Observer Pattern in Ruby

Learn how to implement the observer pattern in Ruby using the built-in Observable module, custom implementations, and ActiveSupport::Notifications.

min read · intermediate · ruby

Service Objects in Ruby

Learn how service objects help you extract complex business logic from your Rails controllers and models into focused, testable Ruby objects.

10 min read · intermediate · ruby

State Machines in Ruby

Model object lifecycles with state machines in Ruby using the AASM gem. Covers states, events, transitions, guards, callbacks, and ActiveRecord integration.

min read · intermediate · gems

The Strategy Pattern in Ruby

Implement the strategy pattern in Ruby to isolate algorithms, swap behaviors at runtime, and replace complex conditionals with interchangeable objects.

min read · intermediate · ruby

String Manipulation in Ruby

A practical guide to manipulating strings in Ruby — covering creation, indexing, slicing, substitution, case conversion, splitting, joining, and encoding.

min read · beginner · ruby

Value Objects in Ruby

Learn how to model immutable, equality-by-value domain concepts in Ruby using Struct, Data, and plain objects.

min read · intermediate · ruby

Comparable and Enumerable in Ruby

Learn how to add comparison operators to your objects with Comparable and supercharge collections with Enumerable in Ruby.

min read · beginner · ruby

IO and Files in Ruby

Read, write, and manage files in Ruby using File, IO, StringIO, and Dir classes with practical examples and common pitfalls.

min read · beginner · ruby

Symbols Deep Dive in Ruby

Learn how Ruby symbols work under the hood, their performance benefits as hash keys, and when to use them over strings.

min read · intermediate · ruby

Benchmarking Ruby Code

Learn how to measure and compare the performance of your Ruby code using the standard library Benchmark module and the benchmark-ips gem.

min read · beginner · ruby

ERB Templates Outside of Rails

Learn how to use Ruby's ERB templating system without Rails for mailers, static site generators, code generation, and more.

min read · intermediate · ruby

Building CLIs with OptionParser

Parse command-line arguments in Ruby with OptionParser. Covers flags, type coercion, custom coercion, and help generation.

min read · beginner · stdlib

DRb — Distributed Ruby

Learn how to build distributed Ruby applications that communicate across processes and networks using DRb's built-in object system.

min read · intermediate · ruby

YAML.safe_load and Safe Serialization

Learn how to safely deserialize YAML in Ruby without exposing your application to remote code execution attacks.

min read · intermediate · stdlib

Lazy Enumerators for Large Datasets

Learn how Ruby's Enumerator::Lazy helps you process large datasets efficiently without loading everything into memory.

min read · intermediate · ruby

method_missing and respond_to_missing?

Learn how Ruby's method_missing and respond_to_missing? work together to create flexible, dynamic interfaces.

min read · intermediate · ruby

Socket Programming in Ruby

Learn how to build network clients and servers using Ruby's socket classes. Covers TCPServer, TCPSocket, UDPSocket, and practical examples.

min read · intermediate · ruby

Tempfile and Tmpdir for Temporary Storage

Learn how to create and manage temporary files and directories in Ruby using Tempfile, Dir.tmpdir, and Dir.mktmpdir.

min read · beginner · ruby

Rails Caching Strategies

Learn how to speed up your Rails applications with low-level caching, fragment caching, Russian doll caching, and cache expiration strategies.

min read · intermediate · rails

Pattern Matching in Ruby

Learn how to use Ruby 3's pattern matching syntax for data validation, API response parsing, and control flow

14 min read · intermediate · ruby

Fiber Scheduler and Async IO

Learn how to use Ruby's Fiber Scheduler for async IO operations, implement non-blocking code, and handle thousands of concurrent connections efficiently.

10 min read · intermediate · ruby

Struct — Lightweight Data Objects in Ruby

Learn how to use Ruby's Struct class to create lightweight, focused data structures without the overhead of full classes

12 min read · beginner · ruby

The Data Class in Ruby 3.2+

Define immutable value objects with Ruby's Data class — frozen by default, keyword-only arguments, and first-class pattern matching support.

min read · intermediate · ruby

Debugging Ruby with the debug Gem

Learn how to use Ruby's official debug gem to step through code, inspect variables, and fix bugs quickly using both CLI and source-based debugging.

8 min read · beginner · ruby

Digest — Hashing with MD5, SHA256 and More

Learn how to compute cryptographic hashes in Ruby with the Digest module — covering SHA256, MD5, SHA1, file hashing, and security considerations.

min read · intermediate · ruby

Frozen String Literals and Immutability

Learn how Ruby handles string immutability with frozen_string_literal, its performance benefits, and how to work with mutable strings when needed.

min read · intermediate · ruby

Ruby GC Tuning and Memory Profiling

Learn how to tune Ruby's garbage collector and profile memory usage in your applications. Covers GC.stat, environment variables, and profiling tools.

min read · intermediate · ruby

Ractor-Based Concurrency

Learn how Ractors communicate via message passing, build pipelines and worker pools, and avoid the shared-state pitfalls of threads.

min read · advanced · ruby

Refinements — Scoped Monkey Patching

Ruby's refinements let you modify core classes without affecting the rest of your codebase. Learn the syntax, scope rules, and gotchas.

min read · intermediate · ruby

How to Work with Arrays in Ruby

A comprehensive guide to creating, manipulating, and iterating over arrays in Ruby with practical examples

20 min read · beginner · ruby

How to Work with Hashes in Ruby

Practical Ruby hash operations: creation, access, iteration, transformation

12 min read · beginner · ruby

How to Work with Strings in Ruby

Essential string manipulation techniques for Ruby developers with practical examples

15 min read · beginner · ruby

Blocks, Procs, and Lambdas Explained

A complete guide to understanding blocks, procs, and lambdas in Ruby — the closure primitives that make Ruby powerful.

15 min read · intermediate · ruby

Sidekiq: Background Jobs in Ruby

A comprehensive guide to background jobs with Sidekiq in Ruby. Learn to offload tasks, manage queues, and scale your applications.

14 min read · intermediate · gems

Concurrency with Threads

Learn how to use Ruby's Thread class for concurrent programming, handle thread-local data, and avoid race conditions and deadlocks.

12 min read · intermediate · ruby

Managing Gems with Bundler

A comprehensive guide to using Bundler for managing Ruby gem dependencies in your projects. Learn about Gemfile, Gemfile.lock, and best practices.

12 min read · beginner · gems

Metaprogramming Basics in Ruby

A comprehensive guide to Ruby's metaprogramming capabilities, covering dynamic methods, define_method, and runtime code execution.

15 min read · intermediate · ruby

Making HTTP Requests in Ruby

Learn how to make HTTP requests in Ruby using Net::HTTP. Covers GET, POST, headers, response handling, and error handling for DevOps scripts.

12 min read · beginner · stdlib

Open Classes and Monkey Patching in Ruby

Learn how Ruby's open classes work, the risks of monkey patching, and best practices for safely modifying existing classes.

12 min read · intermediate · ruby

Regular Expressions in Ruby

A complete guide to regular expressions in Ruby covering pattern matching, common regex features, and practical examples for string manipulation.

12 min read · intermediate · ruby