Lesson available
Values
Practice goal: Predict the result of a number calculation and identify a boolean or nil.
Start here. No programming background assumed.
A route through the language
Find the foundations for what you want to learn.
This is a suggested route through Ruby. Use the prerequisite links to revisit foundations, or jump to a skill you want to practice.
New to programming? Begin with values, then follow the foundations.
Already write Ruby? Try keyword arguments or use the branches to find a topic to revisit.
Lesson available links to practice now. Lesson planned shows future coverage. Blocks and closures share one lesson with six editable examples.
Practice goals are suggestions for checking your understanding.
Start here if you have never programmed.
Lesson available
Practice goal: Predict the result of a number calculation and identify a boolean or nil.
Start here. No programming background assumed.
Lesson available
Practice goal: Assign a value to a local variable and predict its value after reassignment.
Builds on: Values.
Lesson available
Practice goal: Predict the text produced by interpolation in a double-quoted string.
Lesson available
Practice goal: Write an if expression and predict which branch runs for false and nil.
Builds on: Variables.
Lesson available
Practice goal: Write a method with a parameter and explain the value it returns.
Builds on: Variables.
Build on values and conditions to work with groups of data.
Lesson available
Practice goal: Read an element by index and append a value to an array.
Builds on: Variables.
Lesson available
Practice goal: Store and retrieve a value by its key in a hash.
Builds on: Variables.
Lesson available
Practice goal: Use a while loop to visit array elements and explain when it stops.
Builds on: Conditions, Arrays.
Follow methods and arrays into blocks and closures.
Lesson planned
Practice goal: Explain which local variables a method body can access.
Lesson available
Practice goal: Write a method that yields a value to a block.
Lesson available
Practice goal: Explain how two returned lambdas can share a captured variable.
Builds on: Blocks, Local scope.
Lesson available
Practice goal: Use select and map to turn a collection into a new result.
Use methods to organize state and handle errors.
Lesson available
Practice goal: Create two objects and show that each has its own instance variable.
Builds on: Methods.
Lesson available
Practice goal: Include a module and call one of its methods on an instance.
Builds on: Classes.
Lesson available
Practice goal: Raise an error and rescue its specific exception class.
Builds on: Methods, Conditions.
Experienced Rubyists can start here and follow prerequisite links when useful.
Practice available
Practice goal: Write a method with a required keyword and call it with a hash using **.
Practice available
Practice goal: Match a hash with an in pattern and explain what happens when it does not match.
Builds on: Hashes, Conditions.
Lesson planned
Practice goal: Compare a behavior in two Ruby versions and write a small example that exposes the difference.