Language basics
29 steps in 10 sets of Ruby.
Ruby was designed to make programmers happy, and you can feel it under your fingers: methods read like sentences, blocks turn loops into one-liners, and the punctuation budget goes to a few well-chosen sigils instead of ceremony. It powered the Rails wave that built Shopify, GitHub and Airbnb, and it remains one of the fastest languages to think in — what you mean and what you type are unusually close together.
This tour covers the language itself: strings and symbols, the core collections, control flow, and the blocks that make Enumerable the best iteration library anywhere. Then methods, classes, modules and the nil-safety idioms of daily Ruby, closing with files, exceptions and JSON. Every seed runs start to finish under Ruby 3.4 before it reaches you.
Variables & strings
- String interpolationVariables, strings, and the interpolation Ruby reaches for constantly.
- String methodsThe everyday string toolkit: strip, split, sub and friends.
- SymbolsWhy Ruby has two kinds of string and when the lightweight one wins.
Collections
Control flow
- Conditionalsif, elsif, unless and the one-line modifiers that read like prose.
- case and whenPattern dispatch with ===: ranges, classes and regexps all match.
- Loopstimes, upto, while and each — and why bare for loops are rare.
Blocks & iterators
- each and mapThe two iterators that start every Ruby program.
- select and detectFiltering a collection down to the elements you actually want.
- reduceFolding a collection into one value, from sums to custom picks.
Enumerable
- sort_by and group_byOrdering and bucketing with a key function instead of a comparator.
- tally and slicesCounting and windowing built straight into Enumerable.
- Enumerable queriesall?, any?, none? and count: questions a collection answers itself.
Methods & blocks
- Method argumentsDefaults, keyword arguments and splats on ordinary methods.
- yieldMethods that take a block and decide when to run it.
- Procs and lambdasBlocks captured as objects you can store, pass and compose.
Classes & modules
- Classes and attr_readerA minimal class: initialize, instance variables and readers.
- Inheritance and superSubclassing with < and extending a parent method with super.
- Modules and mixinsSharing behavior across classes without inheritance.
Nil & idioms
- nil safetyThe operators that keep nil from taking down a call chain.
- Multiple assignmentUnpacking arrays into variables, swaps, splats and nested pairs.
- Struct and DataValue classes in one line, mutable or frozen.
Files & errors
- FilesWriting, rewinding and reading a file line by line.
- Exceptionsraise, rescue, ensure and a custom error class of your own.
- JSONSerializing to JSON and back with the standard library.
Encore
- Word frequencyA complete script: scan text, count words, print a ranked table.
- Markdown TOCA complete script: parse headings and emit a nested contents list.