Mini Map
Search
⌘ K
AI Features
Log In
Learn Ruby from Scratch
1.
The Big Picture
Programming is Creation
Ruby is Object Oriented
2.
Variables
What are Variables?
Reusing Variable Names
Things on the Right Go First
Quiz on Variables
3.
Built-in Class: Numeric
Working with Numbers
Quiz on Numerics
Exercise 1: Playing with Numbers
Exercise 2: Finding Modulo
Exercise 3: Even or Odd?
4.
Built-in Class: String
Working with Strings
String Interpolation
Quiz on Strings
Exercise 1: Concatenate Substrings
Exercise 2: Padding and Justifying
Exercise 3: Convert String to Float
Exercise 4: Prepend a String
Exercise 5: Remove Characters from a String
5.
Built-in Classes: TrueClass, FalseClass, and NilClass
The true, false, and nil Objects
6.
Built-in Class: Symbol
Working with Symbols
7.
Built-in Class: Array
Working with Arrays
Things We Can Do with Arrays
Quiz on Arrays
Exercise 1: Create an Array
Exercise 2: Interleaving
Exercise 3: Make an Expression
Exercise 4: Replace an Element in the Array
Exercise 5: Retrieve and Recombine Elements of an Array
Exercise 6: Reverse the Array
Exercise 7: Delete an Element
8.
Built-in Class: Hash
Working with Hashes
Things We Can Do with Hashes
Hash Syntax Confusion
Quiz on Hashes
Exercise 1: Create a Hash
Exercise 2: Nested Hash
Exercise 3: Flip the Keys and Values
9.
Objects
Objects, Classes, and Methods
Objects Are Instances of Classes
Objects Have Methods
Calling Methods
Passing Arguments
Listing and Chaining Methods
Predicate Methods
Bangs
Quiz on Objects
Exercise 1: Chaining
10.
Methods
Methods
Constituents
Method Definition
Usage
Return Values
Scopes
Combining Methods
Printing Things
Flow of Execution
Quiz on Methods
Exercise 1: Greet a Person
Exercise 2: Greet Randomly
Exercise 3: Convert Miles to Kilometers
11.
Operators are Methods
Arithmetic Operators
Logical Operators
Comparison Operators
Operators Are Methods
Quiz on Operators
Exercise 1: Check Leap Year
12.
Blocks
What Are Blocks
Alternative Block Syntaxes
Block Arguments
Block Return Values
Exercise 1: Extract Even Elements from an Array
Inversion of Control
Iterators
Quiz on Blocks
Exercise 2: Even Reversed
Exercise 3: Sum the Rows of a Matrix
Exercise 4: Print the Output Using Nested Arrays
Mini Project
Premium
Get Ready for Some More Drill!
13.
Conditionals
What Are Conditionals?
Shorthand Syntax
Conditionals Return Values
Nothingness and the Truth
Quiz on Conditionals
Exercise 1: Number of Days in a Month
14.
Coding Challenge: Truthiness and Equivalence
Challenge 1: Checking Truthiness
Challenge 2: Equivalent Objects
Mini Project
Premium
Lets Run Another Lap with Hashes
15.
Writing Classes
Getting Started with Classes
Defining and Instantiating Classes
Defining Instance Methods
Initializing Objects
Instance Variables
Class Variables
Attribute Readers
Attribute Writers
State and Behavior
Interacting Objects
Object Scope and Self
Quiz on Classes
Exercise 1: Make a Rectangle Class
Exercise 2: On Class Methods
Mini Project
Premium
The Mailbox Project
16.
Spotlight on Things Unremarked
Top-level Object
Escape Sequences
Alternative Syntaxes
Lots of Other Methods
Using the Right Words
Terminology: Arguments vs. Parameters
Arguments and Parentheses
Thought Process Behind Writing a New Method
Attention to the Role Played by a Method
Quiz on Things Unremarked
Exercise 1: Check the Array Equality
17.
Advanced Topics
Using Libraries
Modules
Private Methods
Regular Expressions
More on Character Classes (Regex)
Quiz on Advanced Topics
Exercise 1: Capture the Class Names
Exercise 2: Using a Module
18.
Your Toolkit
Text Editor
Terminal
Interactive Ruby Shell
Programming Independently
19.
Appendix: Mailbox Project Prerequisite
A Brief Detour: HTML
Home
Courses
Learn Ruby from Scratch
Lets Run Another Lap with Hashes
In this mini-project, you’ll perform a sequence of related tasks using hashes.