4.71 out of 5
4.71
5774 reviews on Udemy

Learn to Code with Ruby

Learn to program in the Ruby programming language. Newly updated in 2023 with Ruby 3.2. Complete beginners welcome!
Instructor:
Boris Paskhaver
77,365 students enrolled
English [Auto] More
Learn to program in the Ruby programming language
Master common Ruby objects like Strings, Arrays, Hashes, and more
Solve popular coding challenges and algorithms with Ruby
Dive into object-oriented programming including classes and more

Welcome to the most comprehensive Ruby course available on Udemy! An in-depth overview of coding with Ruby, a popular programming language renowned for its simplicity and elegance. Whether you’ve never written a line of code before or are looking to learn a brand new language, this course covers all bases!

Learn to Code with Ruby offers more than 40+ hours of video tutorials, 250+ lectures, and dozens of quizzes and coding exercises to test your knowledge as you proceed through the course.

Lessons include:

  • Installation and configuration for both Mac OS and Windows systems

  • Common programming concepts (variables, arithmetic, output)

  • Objects and methods

  • Strings

  • Numbers

  • Booleans

  • Methods and Conditionals

  • Ranges

  • Arrays

  • Hashes

  • Blocks, Procs, and Lambdas

  • Dates and times

  • File Input and Output

  • Regular Expression

  • Classes, Modules, and Inheritance

and more!

Ruby is a language released by Yukihiro Matsumoto in 1995 that bills itself as “a programmer’s best friend“. Every aspect of Ruby is designed to make programming easier for the developer. There is no better first language if you’re interested in learning how to program.

Ruby also serves as the foundation for Ruby on Rails, a popular web framework that powers over 1.2 million websites worldwide. The course offers an extensive introduction to the base language you’ll need to know if you intend to tackle web development in the future.

Check out the sample videos below to get a taste of what the course has to offer!

So if you’re ready to commit yourself, if you’re eager to expand your knowledge of programming, if you’re ready to discover what makes this elegant language so loved by developers, you are ready to Learn to Code with Ruby!

Thanks for checking out the course!

Introduction and Installation

1
Welcome to Ruby [SLIDES]

Welcome to Learn to Code with Ruby! In this lesson, we introduce the language, its history, and some of its advantages/disadvantages relative to other languages.

2
Object-Oriented Programming [SLIDES]

Learn about object-oriented programming (OOP), a paradigm that views a software program as a collection of objects that interact with one another. Practice applying OOP principles to real-world objects.

3
Ruby Installation Instructions

In this lesson, we discuss how to install the latest version of Ruby.

4
macOS - Access and Work with the Terminal

In this lesson, we access the Terminal application on a Mac, which is used to issue text commands to the operating system. We explore popular commands like pwd, ls, and cd to traverse directories and explore their contents.

5
macOS - Install XCode Command Line Tools

In this lesson, we'll install the XCode Command Line Tools, a technical prerequisite for installing Ruby on a macOS computer.

6
macOS - Install Homebrew

In this listen, we install Homebrew, a software package manager for macOS. We run Homebrew from our Terminal and use it to download/install applications.

7
macOS - Install rbenv

In this lesson, we install the rbenv Ruby version manager, which enables us to download and install multiple versions of Ruby on the same machine.

8
macOS - Install Ruby

In this lesson, we use rbenv to install Ruby on our macOS operating systems. We target the latest version of Ruby at the time of installation.

9
macOS - Install VSCode Text Editor

In this lesson, we download Visual Studio Code, the free text editor in which we'll be writing our Ruby code throughout the course. We also discuss the benefits of using such a tool.

10
Windows - Access and Work with PowerShell

In this lesson, we introduce the PowerShell command-line application and some common commands including ls for listing files/folders and cd for directory navigation.

11
Windows - Figure Out if System is 32-bit or 64-bit

In this lesson, we use our system settings to determine if our Windows version is 32-bit or 64-bit.

12
Windows - Install Ruby

In this lesson, we walk through the process of installing Ruby on a Windows machine. We also use Powershell to confirm the language was installed properly.

13
Windows - Install VSCode Text Editor

In this lesson, we download Atom, the text editor in which we'll be writing our code throughout the course. We also discuss the benefits of using such a tool.

14
Install VSCode Extensions
15
Add VSCode to Your System PATH

In this lesson, we'll add VSCode and its corresponding Terminal command, code, to our system PATH, which enables the Terminal to locate the software from any directory on our computer.

16
Download Course Materials

Download the course materials for the course in a single zip file.

17
Write First Ruby File and Run with Code Runner

In this lesson, we write our first Ruby program, which outputs the text Hello World to the screen.

18
Write First Ruby File and Run with Terminal or PowerShell

In this lesson, we learn how to run our Ruby file using the ruby program from our Terminal.

19
Interactive Ruby (IRB)

In this lesson, we dive into Interactive Ruby (IRB), a REPL (Read Evaluate Print Loop) program for playing around with the Ruby programming language.

20
Section Review [SLIDES]

In this optional lesson, we'll review the concepts introduced in this course section including:

  • Installing Ruby

  • Running a Ruby file from then Command Line

  • Running a Ruby file with Code Runner

Getting Started

1
The puts Method

In this lesson, we'll learn more about the puts method, which outputs text to the Terminal/output when the program runs. The puts method adds a line break to the end of the output. Like other methods in Ruby, it can be invoked with and without parentheses. We can also use commas to output multiple elements with the put method; Ruby will separate each one with a line break.

2
Escape Characters

In this lesson, we'll introduce escape characters, which are special symbols we can use in a Ruby string. Escape characters add special effects like line breaks, tabs, and  symbols/characters to a string. We escape the expected pattern of output, which is Ruby outputting the literal characters that we've typed.

3
The print Method

In this lesson, we introduce the print method, another way to output text to the screen. The print method is similar to puts but it does not add a line break to the end of the output.

4
The p Method

In this lesson, we learn about the p method, which outputs a "technical" version of the object/output. For example, the p method will print a string with double quotes around the content. It exists primarily for the benefit of developers.

5
Comments

In this lesson, we'll learn how to use comments to ask Ruby to ignore specific lines of code. We create a comment with a hashtag/octothorpe (#) symbol. We can place the hashtag at the beginning of a line or after a line of valid Ruby code. Comments enable developers to leave explanations, metadata, annotations, diagrams, jokes, and more in their program.

6
Outputting Text
7
Multiline Comments

In this lesson, you'll how to create multiline comments using =begin and =end. Ruby will treat any content between the two keywords as part of the comment.

8
Integers and Floating Point Numbers

In this lesson, we'll discuss the differences between integers and floating-point numbers and their syntax in Ruby.

9
Basic Arithmetic in Ruby

In this lesson, we'll learn the symbols for mathematical operations including addition, subtraction, multiplication, division, and modulo.

10
String Concatenation

In this lesson, we'll learn how to concatenate (join) two strings together using the + operator.

11
Intro to Exceptions: TypeError

In this lesson, we'll learn about errors/exceptions in Ruby including TypeError, which Ruby raises when we provide an invalid type of object for an operation.

12
Output and Arithmetic

Review the concepts introduced so far in this section of the course.

13
Section Review [SLIDES]

Review everything we learned in this section of the course including output methods, comments, exceptions, concatenation, and more.

Variables

1
Variables [SLIDES]

In this lesson, we'll learn about variables. A variable is a name we assign to a value in our program that is subject to change over time.

2
Declaring Variables

In this lesson, we practice declaring various variables in a .rb file and using them in expressions throughout the program. The variable syntax declaration begins a name, then an equal sign, and the value/object to assign that name to.

3
Variable Declaration
4
Coding Exercise Solution: Variable Declaration

See the solution to the previous coding challenge.

5
Exceptions: NameError

In this lesson, we'll learn about the NameError exception, which Ruby raises when it cannot recognize a name in your program.

6
Parallel Variable Assignment

In this lesson, we'll learn how to declare multiple variables and provide initial values to them on a single line.

7
Swapping Variable Values

In this lesson, we'll learn how to swap two variables (invert the values they store).

8
Assignment Shortcuts

In this lesson, we'll learn several shortcuts to perform an operation on a variable's value and assign the result back to the original variable.

9
Constants

In this lesson, we'll learn to declare constants in Ruby. A constant is a name for a value that will not change over the program's execution.

10
Section Review [SLIDES]

Review everything we've learned in this course section including variables, constants, parallel variable assignment, and more!

Object Methods

1
Intro to Object Methods

Welcome to the next section of the course! In this lesson, we begin our exploration of methods on various Ruby objects. A method is a message we can send to an object. A method produces a return value, which represents the final output of the method.

2
Integer Methods

In this lesson, we learn about some methods on Ruby's Integer object including next, succ, and pred.

3
Intro to Object Methods
4
Coding Exercise Solution: Intro to Object Methods

See the solution to the previous coding challenge.

5
Exceptions: NoMethodError
6
Method Chaining
7
The inspect Method
8
The nil Object
  • Continue discussion of return values from objects
  • Introduce the nil object which represents nothingness, blankness, or the absence of a value
9
String Interpolation
  • Utilize string interpolation to inject variables or calculations into a string
  • Practice the interpolation syntax -- a hashtag followed by curly braces (#{})
10
The gets Method
  • Use the gets method to collect input from the user
  • Use the chomp method to chop off the newline from the end of a string
  • Write a program to collect input from the user and print it out to them
11
The class Method
12
Methods to Convert Objects
13
Section Review [SLIDES]

Review the concepts introduced in thsi course section including object methods, the nil object, the gets method, the class method, and more.

Booleans and Predicate Methods

1
Intro to Booleans

In this lesson, we'll learn about a new object type called a Boolean, which represents either true or false

2
The Equality Operator

In this lesson, we'll explore the equality operator ( == ), which tests whether two objects are equal.

3
The Inequality Operator

In this lesson, we use the inequality operator ( != ) to test whether two objects are NOT equal.

4
Mathematical Comparisons

In this lesson, we'll learn various mathematical symbols available in Ruby including <, <=, >, and >= for greater-than/less-than logic.

5
Predicate Methods

In this lesson, we'll introduce predicate methods, which are methods that return a Boolean. These methods always end with a question mark.

6
Methods with Arguments (include?)

In this lesson, we'll learn how to pass an argument to a method. An argument is an input we pass to a method that customizes how the method will run.

7
Methods with Multiple Arguments

In this lesson, we'll practice passing multiple arguments to a method with the between? method. The between? method validates whether a number falls between a range.

8
Arithmetic Methods

In this lesson, we'll dive behind the scenes to see how Ruby translates numeric symbols like + into equivalent method calls on objects.

9
Float Methods

In this lesson, we'll learn about exclusive methods on Float objects including floor and ceil.

10
Section Review [SLIDES]

Review the concepts we've learned in this section including Booleans, predicate methods, equality and inequality operators, new object methods, and more.

Methods

1
Intro to Methods

In this lesson, we'll introduce the syntax for declaring a method in Ruby. A method is a reusable procedure that encapsulates a piece of logic; the intent is to capture the logic once and then reuse the method throughout the program.

2
Parameters and Arguments

In this lesson, we'll cover how to define a method with a parameter and utilize the parameter in the method body. We then invoke the method and pass in sample arguments.

3
Multiple Method Parameters

In this lesson, we'll define a method with multiple parameters and pass in multiple arguments for its invocation.

4
Manipulating Arguments

Our method's arguments are regular Ruby objects so we are able to perform operations on them (such as invoking methods). In this lesson, we practice working with string and integer arguments to a custom method.

5
Local Variables

A local variable is a variable declared in a method body. Local variables only exist as long as the method executes. In this lesson, we practice declaring local variables and discuss the idea of scope, the boundary/confines within which a name exists in your program.

6
Return Values I

In this lesson, we'll learn how to declare a return value within our method. A return value is the final output of a method, the final product it creates for the outside world. Every Ruby method has a return value.

7
Return Values II: Implicit Return Values
8
Methods
9
Coding Exercise Solution: Methods

See the solution to the previous lesson's coding challenge.

10
Optional Parameters and Default Arguments

Provide a default argument to a parameter, a fallback value to use when the invocation does not provide one.

11
Optional Parameters and Default Arguments
12
Coding Exercise Solution: Optional Parameters and Default Arguments

See the solution to the previous lesson's coding challenge.

13
Section Review [SLIDES]

In this lesson, we'll review the concepts introduced in this section of the course including:

  • Methods

  • Parameters and arguments

  • Return values

  • Local variables and scope

  • Optional parameters and default arguments

Blocks

1
Introduction to Blocks with the times Method

Welcome to the next section of the course! In this section, we'll focus on blocks in Ruby. A block is a chunk of code that is associated with a method invocation. In this lesson, we introduce the concept in combination with the times method, which repeats a chunk of code a specified number of times.

2
Intro to Blocks
3
Coding Exercise Solution: Intro to Blocks

See the solution to the previous lesson's coding challenge.

4
Block Variables

In this lesson, we'll learn how to use vertical pipes to accept block variables in our blocks. A block variable is a dynamic value that exists only as long as the block does. It is a way for a method to pass data to the block.

5
Block Variables
6
Coding Exercise Solution: Block Variables

See the solution to the previous lesson's coding challenge.

7
The upto and downto Methods

In this lesson, we'll learn two more methods, upto and downto, which move from a starter integer to an end integer in steps of 1.

8
The step Method

In this lesson, we'll learn about the step, which iterates from one numeric value to another in steps/intervals. The method will enable us to practice more with blocks in Ruby.

9
Section Review [SLIDES]

In this lesson, we'll review the concepts introduced in this section of the course including:

  • Adding a block to a method

  • Single-line and multi-line block declaration

  • Differences between blocks and arguments

  • The times, upto, downto, and step methods

Conditionals

1
The if Statement

Welcome to the Conditions section of the course. In this lesson, we'll learn about the if statement, which enables us to run a section of Ruby code if a condition is met. Conditionals enable our programs to have branching logic.

2
Predicate Methods in if Statements

In this lesson, we'll learn how to combine predicate methods with if statements. The two are a perfect duo because an if statement expects a Boolean and a predicate method returns a Boolean.

3
Truthiness and Falsiness

In this lesson, we'll introduces the concepts of truthiness and falsiness. A truthy value is one that is good enough to be true in a Boolean context; a falsy value is one that is good enough to be false in a Boolean context. false and nil are the two falsy values in Ruby; all other objects/values are truthy.

4
if Statements
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.7
4.7 out of 5
5774 Ratings

Detailed Rating

Stars 5
3753
Stars 4
1627
Stars 3
320
Stars 2
43
Stars 1
27
c27c9893693a3525b31c2c57b7471aa9
30-Day Money-Back Guarantee

Includes

43 hours on-demand video
8 articles
Full lifetime access
Access on mobile and TV
Certificate of Completion