Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

Treehouse

Ruby Basics Course (How To)

via Treehouse

Overview

Ruby is a programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. In Ruby Basics, we'll learn how to work with Ruby and write simple Ruby programs.

What you'll learn

  • Ruby syntax
  • Objects
  • Strings
  • Numbers
  • If statements

Syllabus

Ruby Syntax

Learn the basics of writing Ruby programs! You'll see how to define and call methods, and how to store data in variables.

Chevron 16 steps
  • Your First Ruby Program

    3:14

  • Course Overview

    1:56

  • Our Feature List

    0:57

  • Methods

    6:38

  • Methods

    5 questions

  • Methods

    1 objective

  • Comments

    1:36

  • Defining Methods

    4:00

  • Defining Methods

    1 objective

  • Variables

    5:15

  • Variables

    1 objective

  • Method Arguments

    7:02

  • Method Arguments

    1 objective

  • Method Return Values

    11:42

  • Method Return Values

    1 objective

  • Review

    4 questions

Strings

Almost every program needs to work with text. Programming languages represent text using "strings". In this stage we'll take a look at Ruby's powerful features for working with strings.

Chevron 8 steps
  • Strings

    1:27

  • String Concatenation

    6:39

  • String Concatenation

    1 objective

  • String Interpolation

    4:17

  • Inspecting Values

    2:12

  • Escape Sequences

    3:54

  • Escape Sequences

    1 objective

  • Review

    3 questions

Objects

In Ruby, almost every piece of data is an "object". That means the data has useful methods attached to it that you can call. In this stage, we'll learn how to use these methods!

Chevron 4 steps
  • Calling Methods on an Object

    5:13

  • Classes

    6:02

  • Using "chomp" to Fix Our Output

    1:58

  • Calling Methods on an Object

    1 objective

Numbers

Almost every program needs to work with numbers, too. We'll learn about Ruby's two most common types of numbers, how to do math with them, and how to call methods on them.

Chevron 8 steps
  • Numeric Types

    2:32

  • Numeric Types

    1 objective

  • Math Operations

    4:52

  • Math Operations

    1 objective

  • Operator Precedence

    2:12

  • Converting Strings to Numbers

    4:21

  • Converting Strings to Numbers

    1 objective

  • Review

    5 questions

Conditionals

Sometimes you'll need to run a piece of code only under certain conditions. Conditionals like if and unless allow you to do that!

Chevron 9 steps
  • Comparison Operators

    7:59

  • Comparison Operators

    1 objective

  • "if" and "unless" Statements

    6:44

  • "if" Statements

    1 objective

  • Boolean Operators

    9:05

  • "elsif" and "else"

    4:43

  • A Better "check_speed" Method

    1 objective

  • Review

    5 questions

  • Course Summary

    1:37

Taught by

Jay McGavren

Reviews

Start your review of Ruby Basics Course (How To)

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.