Learn to Code with Ruby
4.8 (153 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
3,913 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Learn to Code with Ruby to your Wishlist.

Add to Wishlist

Learn to Code with Ruby

A comprehensive introduction to coding with the Ruby programming language. Complete beginners welcome!
4.8 (153 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
3,913 students enrolled
Created by Boris Paskhaver
Last updated 6/2017
English
Current price: $10 Original price: $60 Discount: 83% off
5 hours left at this price!
30-Day Money-Back Guarantee
Includes:
  • 31.5 hours on-demand video
  • 2 Articles
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Code in the Ruby programming language
  • Utilize common objects like Strings, Arrays, Hashes, and more
  • Solve popular coding challenges with Ruby
View Curriculum
Requirements
  • Basic text editing skills
  • Basic computer skills (web browsing, app installation, file navigation)
Description

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 30+ hours of video tutorials, 250+ lectures, and dozens of quizzes and 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!

Who is the target audience?
  • Beginning programmers who want to start with an easy, human-friendly language
  • Intermediate coders who are interested in exploring the Ruby language in greater depth
  • Web development folk curious about the foundation of Ruby on Rails
Students Who Viewed This Course Also Viewed
Curriculum For This Course
257 Lectures
31:23:33
+
Introduction and Installation
12 Lectures 01:44:26
  • Introduces the Learn to Code with Ruby course 
  • Explores the history and principles of Ruby
  • Dives into the basic ideas in object-oriented design
Preview 13:06


  • Access the Terminal application on Mac OS machines
  • Practice executing common Terminal commands
Mac OS - Access and Work with the Terminal
10:30

  • Use the Terminal to install the Ruby Version Manager (RVM)
  • Use RVM to install version 2.3.3 of Ruby
Mac OS - Install RVM and Install Ruby
18:01

  • Install the Atom text editor developed by Github
  • Configure Atom settings and your coding work environment
Mac OS - Install Atom Text Editor and Atom Runner and Custom Theme
09:42

  • Write and save your first Ruby (.rb file)
  • Run the Ruby file with Atom Runner inside the text editor
Mac OS - Write First Ruby File and Run with Atom Runner
09:35

  • Transition to the Terminal and run the last lesson's Ruby file from the command line
Mac OS - Run Ruby File from Terminal
06:08

  • Download and install Ruby on a Windows machine
  • Walk through the installation process and its settings
Windows - Download and Install Ruby
07:13

  • Install the Atom text editor developed by Github
  • Configure Atom settings and your coding work environment
Windows - Install Atom Text Editor and Atom Runner and Custom Theme
09:36

  • Write and save your first Ruby (.rb file)
  • Run the Ruby file with Atom Runner inside the text editor
Windows - Write First Ruby File and Run with Atom Runner
07:28

  • Transition to the Windows Command Prompt and run the last lesson's Ruby file
Windows - Run Ruby File from Command Prompt
05:09

  • Explore the benefits of Interactive Ruby (IRB), a REPL (Read Evaluate Print Loop) program for playing around with Ruby
  • Begin discussion of the idea of return values from statements
Interactive Ruby (IRB)
07:27
+
Getting Started
12 Lectures 01:42:22
  • Use the puts method to output or log text
  • The puts method adds a line break to the end of the output
The puts Method
10:19

  • Use the print method to output or log text
  • The print method does not add a line break to the end of the output
The print Method
03:18

  • Use the p method to see a more literal output of a Ruby string or object
  • This is equivalent to calling the .inspect method on an object
The p Method
04:34

  • Perform basic addition, subtraction, multiplication, and division with Ruby
  • Explore the syntax behind these arithmetic operations
Preview 09:57

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

Output and Arithmetic
10 questions

  • Use comments to tell Ruby to ignore specific lines of code
  • Comments are created with the hashtag / octothorpe (#) symbol
Preview 06:34

  • Explore variables, which serve as pointers to objects in Ruby
  • Practice assigning values to variables
Preview 13:39

  • Assign multiple variables values at once
  • Learn how to swap the values in two variables
Parallel Variable Assignment and Swapping Variable Values
06:51

  • Declare constants, whose value should not change throughout the program
Constants
04:01

  • Begin our exploration of methods on various Ruby objects. A method is simply a message sent to an object
  • Start discussion of return values, the final output of a method
Intro to Object Methods
08:07

  • Continue discussion of return values from objects
  • Introduce the nil object which represents nothingness, blankness, or the absence of a value
Return Values and the nil Object
09:14

  • Utilize string interpolation to inject variables or calculations into a string
  • Practice the interpolation syntax -- a hashtag followed by curly braces (#{})
String Interpolation
10:24

  • 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
The gets Method and the chomp Method
15:24

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

Variables, Constants, Object Methods, Return Values, String Interpolation
7 questions
+
Numbers and Booleans
14 Lectures 01:47:37
  • Call the .class method to return the class of the object, the blueprint from which it is built
Intro to Numbers and the .class Method
07:49

  • Utilize methods like to_s and to_s to convert numeric objects to strings and vice versa
Convert Numbers to Strings and Vice Versa
08:34

  • Learn about a new object type called a Boolean, which represents either true or false
Intro to Booleans
04:50

  • Explore predicate / Boolean methods available on objects which always return a true or false
  • Call the odd? and even? methods on integer objects to see if they are odd or even
The .odd? and .even? Predicate Methods
05:49

  • Use the equality operator ( == ) to test whether two objects are equal
Comparison with the Equality (==) Operator
06:41

  • Use the inequality operator ( != ) to test whether two objects are NOT equal
Comparison with the Inequality (!=) Operator
04:34

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

Boolean Values, Predicate Methods, Equality and Inequality
5 questions

  • Use the and > operators to compare whether one number is less than or greater than another
  • Explore the related <= and >= operations to test less than / greater than or equal to
Less than and Greater than Operators
05:15

  • Dive behind the scenes to see how Ruby processes basic arithmetic methods
  • Begin a deep dive into arguments, which are inputs passed to a method call
Arithmetic Methods and Basic Arguments
09:07

  • Continue exploration of parameters and arguments in more detail
  • Call the between? predicate method to test whether a number falls in between two others
Intro to Object Methods with Parameters (The .between? Predicate Method)
08:22

  • Call some exclusive methods available on Float objects, which include a decimal component
Float Methods
06:48

  • Use a popular programming shortcut to perform a mathematical operation on a variable and overwrite the variable's value
Assignment Operators
07:54

  • Call the .times method on an integer to repeat a certain operation that number of times.
  • Introduce the concept of blocks, an attachment to a method call that modifies its functionality
Preview 14:33

  • Call the .upto and .downto methods on an integer to iterate from that number to another
  • Further enhance our knowledge of blocks and block variables
The .upto and .downto Methods
09:42

  • Call the .step method on an integer to iterate from that number to another at a frequent interval
  • Further enhance our knowledge of blocks and block variables
BONUS - The .step Method
07:39

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

Object Methods, Parameters and Arguments, Float Methods, and Blocks
5 questions
+
Strings I
16 Lectures 01:31:36
  • Practice multiple syntactical options for creating a new String object.
  • Call common methods like .length and .class on String objects.
Create a String
07:25

  • Use multiline strings to create strings that utilize more than one line.
Multiline Strings
04:02

  • Use a special syntax to signify escape characters in string
  • Escape characters have special meanings like line breaks, backslashes, or double quotes
Escape Characters
08:03

  • Learn the differences between using single vs. double quotes for creating strings.
  • Double-quoted strings allow for interpolation and escape characters.
Single Quotes vs Double Quotes
02:20

  • Review the equality (==) and inequality (!=) operators
  • Use the two operators on String objects
Equality and Inequality Operators with Strings
07:12

  • Add / concatenate one string to another with concatenation operators / methods
Concatenate Strings
07:44

  • Call the .length or .size method to return the numbers of characters in the string
  • See what happens when the methods are called on an empty string
The .length and .size Methods
06:02

  • Use bracket syntax to extract a single character from a string
Extract Single Characters from String with Bracket Syntax
07:45

  • Use bracket syntax with a few tweaks to extract multiple sequential characters from a string
Extract Multiple Characters from String with Bracket Syntax
04:09

  • Introduce the Range object which represents an interval of numbers or characters
  • Feed the range to the bracket syntax to extract sequential characters from a string
Extract Multiple Characters with Range Objects
05:54

  • Combine bracket syntax from previous lessons with the assignment operator (=) to mutate a string by assigning new characters
Overwrite Characters in String with Bracket Syntax
05:14

  • Call the .downcase.upcase.capitalize, and .swapcase methods to modify the casing of a string
  • The methods each return a new String object
Case Methods
05:43

  • Call the .reverse method on a String to reverse the order of its characters
The .reverse Method on a String
03:10

  • Introduce bang methods, which mutate the original object the method is called on
  • Bang methods are an alternative to reassigning the return value of a method call to the same variable
Bang Methods on Strings
07:20

  • Call the .include? predicate method to check if a certain substring is found in the string
The .include? Method on a String
05:32

  • Call the .empty? predicate method to check if a string contains no characters
  • Call the .nil? method which returns true only if called on a nil object
The .empty? and .nil? Methods on a String
04:01

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

Common String Methods
10 questions
+
Methods and Conditionals I
17 Lectures 02:28:13
  • Introduce the purpose and syntax of a method.
  • Transition to Atom Text editor and write our first method.
Preview 12:57

  • Define local variables within a method.
  • Local variables disappear as soon as the method is done executing.
Local Variables
04:16

  • Add one or more arguments to a method to allow for input when the method is invoked
  • A parameter is the name for an expected method argument
Parameters and Arguments
09:16

  • Return a value from a custom method
  • Differentiate between an explicit and implicit method return
Return Values I
07:23

  • Discover the default return value of a method
  • Explore why nil is the return value of the puts method
Return Values II - Default Return Values and the Return of the puts Method
06:14

  • Use the if statement, our first conditional, to evaluate code only if a condition evaluates to true
The if Statement
10:19

  • Explore the concept of truthiness and falsiness in Ruby.
  • false and nil are falsy in Ruby.
  • All other objects are truthy.
Truthiness and Falsiness
07:06

  • Add an elsif statement to check for the truthiness of another condition.
  • Structure the code to follow a more complex logical path
if elsif
09:02

  • Fallback on the else keyword to execute code if no if or elsif condition above is met
The else Keyword
08:01

  • Employ the AND operator (&&) to check for multiple conditions in an if or elsif statement
Multiple Conditions with && Operator
12:48

  • Employ the OR operator (||) to check if either one of two or more conditions is true.
Multiple Conditions with || Operator
05:10

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

Truthiness and Falsiness
8 questions

  • Add parentheses when using && and || operators to establish the precedence for evaluating a condition
Parentheses and Precedence
08:33

  • Nest an if statement inside another to create a more complex logical path
Nested if Statements
08:04

  • Call the .respond_to? predicate method to test whether an object can respond to a specific method
The .respond_to? Method
09:29

  • Consolidate a simple if / else design by replacing it with the terser ternary operator
Ternary Operator
12:36

  • Provide default / optional parameters to methods that will activate if the arguments are not passed on a method call
Default or Optional Parameters
06:24

  • Invoke one method from the body of another
  • Invoke a method from inside a string using interpolation syntax
Call A Method from Another Method or Interpolated String
10:35
+
Methods and Conditionals II
8 Lectures 01:10:00
  • Replace longwinded if / elsif / else statements with the case statement
The case Statement
12:03

  • Utilize the exclamation point (!) to negate the value of an object and convert it to a Boolean
  • Use two exclamation points (!!) to return the Boolean representation of an object.
Negation with !
06:09

  • Use the unless keyword to simulate an "execute if false" condition for a piece of code.
The unless Keyword
07:44

  • Begin discussion of a loop, an iteration that is repeated a specified number of times
  • Introduce the while keyword for looping while a condition is true
The while Keyword
15:38

  • Continue discussion of loops and iterations
  • Introduce the until keyword for looping until a condition is true
The until Keyword
04:20

  • Tackle Fizzbuzz, a popular coding challenge for beginners
CHALLENGE: FizzBuzz
11:56

  • Replace simple if and unless statements with shorter inline statements
  • The end keyword is not required with this simplified format
Statement Modifiers / Inline Modifiers
05:36

  • Assign a value to a variable only if it is currently set to nil.
  • Explore the advantages of this approach in professional code.
Conditional Assignment
06:34

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

The case statement, Negation, the unless, while, and until Keywords, and More!
5 questions
+
Ranges
5 Lectures 25:27
  • Introduce the Ruby Range object for storing an interval or sequence of numbers / characters
  • Call the .class.first, and .last methods on a Range object
Preview 07:45

  • Generate a Range object of alphabetic characters
  • Explore the caveats of uppercase and lowercase character ranges
Alphabetical Ranges
05:36

  • Call the .size method on a Range object to see the size of its interval
The .size Method on a Range
01:45

  • Use the .includes? predicate method to see if a value falls between a Range
  • Use the === syntax to see if a value falls between a Range
Check if Value Exists in a Range with .includes? Method or ===
04:24

  • Explore the Ruby rand method to generate a random floating point number or integer
  • Provide the method a Range argument to get a number in between the interval
Generate A Random Number with the rand Method
05:57

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

Range Objects
3 questions
+
Arrays I - Creation, Addition, and Modification
21 Lectures 02:06:15
  • Explain the Array object, a container to store other objects in a sequenced order.
  • Create an empty array and call the .class method on it.
Preview 03:59

  • Instantiate multiple arrays full of different data types.
  • Nest one array within another.
Create An Array with Bracket Syntax
09:17

  • Utilize the %w syntax to easily generate an array of strings.
  • Elements in the brackets are written without quotes or commas.
Shorthand %w Syntax to Create an Array of Strings
02:10

  • Utilize the Array.new method to create a new array.
  • Populate a new array with a consistent set of values.
Create an Array with Array.new Method
03:31

  • Use square bracket syntax to select an element from an array.
  • The first array element will have an index position of 0.
Access Single Array Element by Index Position
11:57

  • Call the .fetch method on an array to extract an element by index position.
  • Compare the differences between square bracket syntax and .fetch
Access Single Array Element with .fetch Method
04:08

  • Extract multiple array elements with square bracket syntax
  • Choose a starting point and the number of elements to select
Extract Sequential Array Elements with Bracket Syntax
06:11

  • Feed a Range object to square brackets to extract multiple array elements.
  • Review the differences between an inclusive and exclusive range.
Access Sequential Array Elements with a Range Object
04:01

  • Call the .values_at method on an array to extract non-sequential array elements.
  • Extract an array element more than once.
Access Multiple Array Elements with the .values_at Method
05:00

  • Call the .slice method as an alternative to using square bracket syntax for array element extraction.
The .slice Method
02:33

  • Extract one or more array elements with familiar [] or .slice syntax.
  • Overwrite the array element(s) with the equal sign (the assignment operator).
Overwrite One or More Array Elements
08:06

  • Call the .length.size, or .count methods to return the number of elements in an array.
  • An empty array will return 0.
The .length, .size and .count Methods on an Array
04:56

  • Call the .empty? method which returns true if the array has no elements
  • Call the .nil? method which returns true if called on a nil object.
The .empty? and .nil? Methods on an Array
05:17

  • Call the .first and .last elements on an array to return the first and last elements.
  • Call the two methods with an optional numeric argument to return an array of results.
The .first and .last Methods
11:11

  • Call the .push method to add an element to the end of an array.
  • Use the shovel operator (<<) to accomplish the equivalent of the .push method
  • Call the .insert method to insert an element in a specific index position.
The .push Method, the Shovel Operator, and the .insert Method
07:04

  • Call the .pop method to remove an element from the end of the array.
  • The .pop method also returns the element itself.
The .pop Method
05:15

  • Call the .shift method to remove an element from the beginning of the array.
  • Call the .unshift method to add an element to the beginning of the array.
The .shift and .unshift Methods
03:16

  • Use the equality (==) and inequality (!=) operators to compare two arrays
Equality and Inequality Operators with Arrays
05:05

  • Use the spaceship operator (<=>) to compare two arrays together.
  • -1 will be returned if the array on the left is less than the one on the right.
  • 0 will be returned if the two array are equal.
  • 1 will be returned if the array on the left is greater than the one on the right.
The Spaceship Operator
06:14

  • Call the .to_a method on a Range object to convert it to an array
Convert Ranges to Arrays with the .to_a Method
04:18

  • Call the .is_a? predicate method on a variety of objects to test whether they inherit functionality from a specific class.
  • The method will return true for an object's class or any of the superclasses above it.
The .is_a? Predicate Method
12:46

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

Arrays I - Creation, Addition, and Modification
10 questions
+
Arrays II - Iteration and Various Methods
22 Lectures 02:15:01
  • Use the ri program from the Command Line to retrieve documentation on a Ruby class or an instance method
The ri Program
07:48

  • Review blocks, which are attachments to methods that modify how they function.
  • Review the two syntax options for a block (curly braces and do end).
Review of Blocks
05:19

  • Call the .each method on an array to iterate over its elements one by one
  • Provide the .each method a block to specify what to do on each iteration
The .each Method on an Array
06:59

  • Provide block variables to an .each method block to represent the current array element being iterated over.
More Practice with the .each Method
12:59

  • Nest an .each method call within another .each method.
each within each
04:02

  • Utilize the for loop to iterate over an array.
  • Compare the differences between for and the .each method.
  • See why the .each method is strongly preferred.
The For Loop
09:31

  • Call the .each_with_index method to iterate over an array while keeping track of the index position.
  • Provide a second block variable to hold the place of each index position.
The .each_with_index Method
06:35

  • Tackle a programming problem that involves the .each_with_index method on an array.
CHALLENGE: The .each_with_index Method
07:02

  • Call the .map or .collect method to iterate over an array, apply an operation to each element, and return a new array of the resulting elements.
  • Practice the method with another challenge.
The .map and .collect Methods on an Array
12:14

  • Use the while and until loops as an alternative approach to iterate over array elements.
Iteration over Array with while or until Loops
05:35

  • Use the break keyword to break out of loop if a condition is met on an iteration.
The break Keyword
06:19

  • Use the next keyword to continue to the next iteration of a loop if a condition is met.
The next Keyword
03:37

  • Call the .reverse method on an array to rotate it, to present its elements in the opposite order.
The .reverse Method on an Array
02:24

  • Call the .sort method to sort the elements in an array.
  • The results will be in ascending order if an array consists of numeric element.
  • The results will be in alphabetical order if an array consists of strings.
The .sort Method on an Array
05:17

  • Call the .concat method on an array to merge it with another array.
The .concat Method on an Array
04:46

  • Call the .max method on an array to return its largest element.
  • Call the .min method on an array to return its smallest element.
The .max and .min Methods on an Array
09:06

  • Call the .include? predicate method on an array to test whether it includes a value.
The .include? Predicate Method on an Array
02:11

  • Call the .index or .last_index method on an array to return the index position of the first occurrence of the argument.
  • The methods will return nil if the element does not exist.
The .index and .find_index Methods on an Array
02:51

  • Call the .select method on an array to return an array of elements for which the block condition evaluates to true.
Preview 06:45

  • Call the .reject method on an array to return only those elements that do not fit the block condition.
The .reject Method on an Array
02:53

  • Place multiple variables on the left side of an assignment operator to unpack a multi-dimensional array and assign each nested element to a variable.
Unpack a Multidimensional Array
05:44

  • Combine the functionalities of the .select and .reject methods in the .partition method, which returns a multidimensional array.
The .partition Method on an Array
05:04

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

Arrays II - Iteration and Various Methods
9 questions
+
Strings II
9 Lectures 01:00:49
  • Call the .split method on a string to separate it by the occurrence of a delimiter and return an array of the results.
Preview 05:27

  • Iterate over a string's characters by calling the .split or .chars method and then the .each method on the result array.
  • An alternative is the .each_char method on the string.
Iterate over String Characters
04:40

  • Call the .join method on an array to combine each of its elements and separate each with a delimiter.
The .join Method on an Array
10:30

  • Call the .count method on a string to return the number of times a substring appears in the string.
The .count Method on a String
06:44

  • Call the .index method to return the first index position where the substring is found.
  • Call the .rindex method to return the last index position where the substring is found.
  • Emulate the functionality of the .index method with our own custom method.
The .index and .rindex Methods on a String
12:36

  • Call the .insert method to insert a character or characters at a specified index position in a string.
The .insert Method on a String
02:29

  • Call the .squeeze method to remove all characters that occur two or more times in sequence.
The .squeeze Method
11:21

  • Call the .clear method on a string to rid it of content and return an empty string.
The .clear Method on a String
01:26

  • Call the .delete method to remove all occurrences of the substring characters from the original string.
The .delete Method on a String
05:36

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

Strings II
5 questions
13 More Sections
About the Instructor
Boris Paskhaver
4.6 Average rating
897 Reviews
24,472 Students
2 Courses
Software Engineer

Hi there, I'm a NYC-based web developer with experience building apps in React / Redux and Ruby on Rails.

Raised in New Jersey, I graduated from the Stern School of Business at New York University in 2013 with a double major in Business Economics and Marketing. Since graduation, my work has taken me in a wide variety of directions -- I spent a year in marketing, then financial services, and now the tech industry. I've worked everywhere from a 50-person digital agency to an international tech powerhouse with thousands of employees.

I've always had a love of learning but have struggled with the traditional resources available for education. I've used that as inspiration for my work here. My goal is to create comprehensive courses that break down the complex details into small, digestible pieces. I hope to see you in a course soon.