Learn how to work with procs and lambdas in Ruby: how to create them, how arity and return differ between the two, and when to choose each in real code.
Tutorial series
Intermediate Ruby
5 tutorials — follow in order for the best learning path.
- Working with Procs and Lambdas: A Ruby Tutorial
- Ruby Enumerable: map, filter, and aggregate collections
Learn how the Ruby Enumerable module helps you map, filter, search, group, and aggregate collections with practical examples.
- The Comparable Module in Ruby: Sorting and Comparison Made Simple
Learn how to use Ruby Comparable module to add sorting and comparison methods to your classes with the spaceship operator, including multi-criteria ordering.
- Working with Ruby symbols vs strings: when to use each
Learn how working with Ruby symbols vs strings affects memory and performance, and when to use each type for hash keys, method names, and user input in Ruby.
- Testing RSpec in Ruby: Practical BDD Tutorial
Hands-on tutorial for testing RSpec in Ruby. Covers describe blocks, matchers, hooks, let, mocking, and the testing workflow you can reuse in real projects.