Log In
Join
for free
Back To Module Home
Learn Ruby from Scratch
0% completed
The Big Picture
Programming is Creation
Ruby is Object-oriented
Variables
What are Variables?
Reusing Variable Names
Things on the Right go First
Quiz on Variables
Built-in Class: Numeric
Working with Numbers
Quiz: Float or Integer
Exercise 1: Playing with Numbers
Exercise 2: Finding Modulo
Exercise 3: Even or Odd?
Built-in Class: String
Working with Strings
String Interpolation
Quick Quiz
Exercise 1: Concatenate Substrings
Exercise 2: Padding & Justifying
Exercise 3: Convert String to Float
Exercise 4: Prepend a String
Exercise 5: Remove Characters from String
Built-in Classes: TrueClass, FalseClass and NILClass
The true, false, and nil Objects
Built-in Class: Symbol
Working with Symbols
Built-in Class: Array
Working with Arrays
Things You Can Do with Arrays
Quick Quiz
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
Built-in Class: Hash
Working with Hashes
Things You Can Do with Hashes
Hash Syntax Confusion
Quiz: Guess the Answers
Exercise 1: Create a Hash
Exercise 2: Nested Hash
Exercise 3: Flip the Keys and Values
Objects
Objects, Classes and Methods
Objects are Instances of Classes
Objects have Methods
Calling Methods
Passing Arguments
Listing and Chaining Methods
Predicates
Bangs
Quick Quiz on Objects
Exercise 1: Chaining
Methods
Methods
Constituents
Method Definition
Usage
Return Values
Scopes
Combining Methods
Printing Things
Flow of Execution
Exercise 1: Greet a Person
Exercise 2: Greet Randomly
Exercise 3: Convert Miles to Kilometers
Exercise 4: Check Leap Year
Operators are Methods
Arithmetical Operators
Logical Operators
Comparison Operators
Operators are Methods
Quick Quiz on Operators
Blocks
What are Blocks?
Alternative Block Syntaxes
Block Arguments
Block Return Values
Exercise 1: Extract Even Elements from Array
Inversion of Control
Iterators
Quick Quiz
Exercise 2: Even Reversed
Exercise 3: Sum the Rows of a Matrix
Exercise 4: Print the Output Using Nested Arrays
Project
Get Ready for some more Drill!
Conditionals
What are Conditionals?
Shorthand Syntax
Conditionals Return Values
Nothingness and the Truth
Quick Quiz on Conditionals
Exercise 1: Number of Days in a Month
Coding Challenge: Truthiness and Equivalence
Challenge 1: Checking Truthiness
Challenge 2: Equivalent Objects
Project
Lets run another lap with hashes
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
Quick Quiz on Classes
Exercise 1: Make a Rectangle Class
Exercise 2: On Class Methods
Project
Mini project 1
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
Quick Quiz
Exercise 1: Check the Array Equality
Advanced Topics
Using Libraries
Modules
Private Methods
Regular Expressions
More on Character Classes (Regex)
Quick Quiz
Exercise 1: Capture the Class Names
Exercise 2: Using a Module
Your Toolkit!
Text Editor
Terminal
Interactive Ruby shell
Programming Independently
Appendix: Mailbox Project Prerequisite
A brief detour: HTML
Conclusion
Final Remarks
Home
/
...
/
Quiz: Guess the Answers
Quiz: Guess the Answers
Take a quiz on some hash concepts.
Quiz scenario
Consider a hash named
...