← Ruby Playground

A route through the language

Ruby skill tree

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.

01 Foundations

Start here if you have never programmed.

  • Lesson available

    Values

    Practice goal: Predict the result of a number calculation and identify a boolean or nil.

    Start here. No programming background assumed.

  • Lesson available

    Variables

    Practice goal: Assign a value to a local variable and predict its value after reassignment.

    Builds on: Values.

  • Lesson available

    Strings

    Practice goal: Predict the text produced by interpolation in a double-quoted string.

    Builds on: Values, Variables.

  • Lesson available

    Conditions

    Practice goal: Write an if expression and predict which branch runs for false and nil.

    Builds on: Variables.

  • Lesson available

    Methods

    Practice goal: Write a method with a parameter and explain the value it returns.

    Builds on: Variables.

02 Collections and repetition

Build on values and conditions to work with groups of data.

  • Lesson available

    Arrays

    Practice goal: Read an element by index and append a value to an array.

    Builds on: Variables.

  • Lesson available

    Hashes

    Practice goal: Store and retrieve a value by its key in a hash.

    Builds on: Variables.

  • Lesson available

    Loops

    Practice goal: Use a while loop to visit array elements and explain when it stops.

    Builds on: Conditions, Arrays.

03 Behavior and captured state

Follow methods and arrays into blocks and closures.

04 Objects and failure

Use methods to organize state and handle errors.

05 Language details and changes

Experienced Rubyists can start here and follow prerequisite links when useful.

  • Lesson planned

    Ruby release changes

    Practice goal: Compare a behavior in two Ruby versions and write a small example that exposes the difference.

    Builds on: Methods, Blocks, Classes.