Advanced Ruby Programming: 10 Steps to Mastery
3.8 (397 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
21,634 students enrolled

Advanced Ruby Programming: 10 Steps to Mastery

Take your Ruby programming to the next level with Huw Collingbourne's simple guide to advanced Ruby coding.
3.8 (397 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
21,634 students enrolled
Created by Huw Collingbourne
Last updated 7/2020
English [Auto]
Current price: $51.99 Original price: $74.99 Discount: 31% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 3.5 hours on-demand video
  • 3 articles
  • 9 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Encapsulation and data hiding
  • Singleton classes and methods
  • Exception handling
  • Threads and fibers
  • Modules and mixins
  • File handling
  • YAML and Marshal
  • Regular Expressions
  • Metaprogramming
Course content
Expand all 38 lectures 12:02:29
+ Getting ready to go further in Ruby
9 lectures 34:26

What is this course about and who is it for? Watch this video to find out.

Preview 02:12

This is an intermediate-to-advanced level course on Ruby programming. It can be used with any code editor or IDE and any operating system that supports Ruby. This video provides a quick overview of the course and gives a few tips on how to get the most from it.

Preview 04:29
Here I explain the principal resources supplied by this course and how you should use them.
Preview 03:46

This is the 'course text' – a short eBook that summarizes the most important topics from each of the steps of this course. Use this book to revise the subjects. It also contains links to useful resources such as Ruby installers, editors and IDEs.

Advanced Ruby Course Notes
47 pages

This contains an archive of all the code to accompany The Book Of Ruby and this course

Code Archive
237.2 kB
The Book Of Ruby is an extensive and in-depth eBook on Ruby programming. It provides a more in-depth text than the Course Notes (which are also downloadable from this section of the course). In over 420 pages The Book Of Ruby covers the Ruby language in great depth, starting with the very basics before moving onto quite complex subjects such as Exceptions regular expressions, threads and metaprogramming. Use this book to deepen your understanding of the topics covered in the video tutorials. All the sample programs mentioned in this book are provided for your use in the downloadable code archive.

Table of Contents


Chapter 1: Strings, Numbers, Classes, and Objects
Chapter 2: Class Hierarchies, Attributes, and Class Variables
Chapter 3: Strings and Ranges
Chapter 4: Arrays and Hashes
Chapter 5: Loops and Iterators
Chapter 6: Conditional Statements
Chapter 7: Methods
Chapter 8: Passing Arguments and Returning Values
Chapter 9: Exception Handling
Chapter 10: Blocks, Procs, and Lambdas
Chapter 11: Symbols
Chapter 12: Modules and Mixins
Chapter 13: Files and IO
Chapter 14: YAML
Chapter 15: Marshal
Chapter 16: Regular Expressions
Chapter 17: Threads
Chapter 18: Debugging and Testing
Chapter 19: Ruby on Rails
Chapter 20: Dynamic Programming

Appendix A: Documenting Ruby with RDoc
Appendix B: Installing MySQL for Ruby on Rails
Appendix C: Further Reading
Appendix D: Web sites
Appendix E: Ruby Development Software

The Book Of Ruby (course eBook)
422 pages
Subscribers to this course are entitled to a 30% discount off the price of my other Ruby programming book, The Book Of Ruby , published by No Starch Press. In around 400 pages, The Book Of Ruby goes into more advanced Ruby topics such as blocks and nameless functions, threads and fibers, self-modify…
The Book Of Ruby paperback (exclusive discount)

An overview of how to test conditions in Ruby and a first look at the alternative Boolean operators: and/&&, or/||, !/not

Conditional Statements

An explanation of why the same tests may produce different results if you change the style of Boolean operators. Also a look at the various types of if, else and unless tests, plus case statements.

Boolean tests and operators

Performing tests in Ruby may seem easy. But there are some complexities which, unless you are very careful, can change the way your program works. Use this quiz to test your understanding...

Tests and Conditions
3 questions
+ Classes, class methods and singletons
3 lectures 21:29

What are class methods and what are they used for? 

Class Methods

How to use class methods and class variables and why it’s important to understand that classes are objects too!

Class methods and variables in use

How to add methods to a specific object rather than to an entire class

Singleton methods and classes

The difference between class and instance methods and variables, plus singletons.

Class methods and variables
3 questions
+ Arguments, return values and encapsulation
2 lectures 18:35

Regular arguments and default arguments, a discussion of parentheses, single and multiple return values and parallel assignment

Passing Arguments and Returning Values

Usually, there is one way to pass data to a method in a Ruby object and one way to get data back out again. But there are exceptions to the rule. Here I discuss the importance of encapsulation and information hiding.

Encapsulation and information hiding

Information-hiding, returning values from methods and unintentional side-effects

Arguments and Encapsulation
3 questions
+ Exception Handling
2 lectures 12:42

Trapping exceptions and recovering from errors in your code. The fundamentals of exception handling techniques in Ruby.

Recovering from Errors

Exceptions are objects and they have a class hierarchy which can be useful to you when handling specific types of error

The Exception class hierarchy

How to deal with errors

3 questions
+ Blocks, Procs and Lambdas
2 lectures 15:59

In Ruby blocks are like ‘nameless methods’ that are often used in iterators. This short video explains the basics

What are Blocks?

Blocks, procs, lambdas, block parameters, closures, passing blocks as arguments, yielding anonymous blocks and using blocks as iterators

Blocks In Depth

How to pass and execute blocks to methods. Careful! This is quite tricky!

Blocks, call and yield
3 questions
+ Symbols, Threads and Fibers
3 lectures 13:33

Symbols are widely used in Ruby programming. Here we find out what’s special about them


This is Chapter 11 of The Book Of Ruby. It explains symbols.

Bookofruby Ch11
570.6 kB

Threads and Fibers can help you to write programs that do more than one thing at a time. But they can be tricky things to use effectively!

Threads and Fibers

What are Ruby Symbols? And how can threads help your programs multitask?

Symbols and Threads
3 questions
+ Modules and Mixins
3 lectures 20:27

Ruby does not implement ‘multiple inheritance’. So how can a class include features from multiple parent classes? The answer is: it can’t. But it can mix-in multiple modules…

Mixed-in Modules

You just have to look at a module definition to see how similar it is to a class. But the resemblance is not superficial. Here I explain the relationship between a Class and a Module.

Modules and Classes

Modules as namespaces and as mixins. How to access module constants, module methods and instance methods and how to avoid potential problems 

Modules In Depth

Modules, mixins and methods

3 questions
+ Files, YAML and Marshal
3 lectures 23:32

How to use Ruby's File and IO classes to read, write and copy files. How to find file information and traverse directories and subdirectories recursively.

Files and IO

How to save and load structured data to and from disk in a human readable format.


You can use Marshal to read and write byte streams of data to and from disk


Opening and closing files, reading and writing data

Dealing with files
3 questions
+ Regular Expressions
2 lectures 16:11

This explains the fundamentals of matching text patterns to find or modify strings using Regular Expressions

Regular Expressions – an overview

Some sample programs show how you can match patterns substitute text or create new files – for example, containing extracted documentation – using Regular Expressions

Processing files with Regular Expressions

Matching and replacing text patterns

Regular expressions
3 questions
+ Dynamic Ruby and metaprogramming
2 lectures 15:34

How to add and remove methods at runtime, deal with method-calls to methods that don’t exist and evaluate strings as Ruby code.

Dynamic features of Ruby

In Ruby you don’t have to write a complete program before you run it. You can add new Ruby code to the program that is running. Here’s a simple example.

Writing Ruby programs at runtime!

Blurring the boundaries between code and data

3 questions

Advanced Ruby: a 2nd-level course. If you have already done some Ruby programming, this course will help to take your coding to the next level. It explains some of the more advanced features of Ruby including blocks and procs, threads, regular expressions, exception handling, singletons and metaprogramming. The course is based on Huw Collingbourne's book, The Book Of Ruby (a copy of 3rd PDF edition of the book is supplied with this course). All the source code is provided in the code archive. This course can be used with any editor or IDE and on any operating system that supports Ruby. If you are ready to go beyond the basics and gain a deeper understanding of how Ruby really works, this course is for you.

Note: If you're new to programming, check out Ruby Programming for Beginners (now with over 24,000 students enrolled!).

Who this course is for:
  • This course is for anyone who already knows the fundamentals of Ruby and wants to take their Ruby coding skills to a higher level. Here you'll learn the tricks and techniques of the Ruby masters