Ruby
Learn Ruby 3: objects, blocks and lambdas, Enumerable, modules and mixins, pattern matching, metaprogramming and DSLs, gems, RSpec, YJIT and Rails basics.
Start course →
What you'll learn
- Explain Ruby's object model and set up projects with version managers, gems and Bundler.
- Write idiomatic control flow and use arrays, hashes, Enumerable and blocks effectively.
- Design classes, modules and value objects with mixins, visibility and inheritance.
- Use flexible method arguments, exceptions and pattern matching for robust code.
- Apply duck typing, refinements, metaprogramming and DSLs responsibly, and handle files, text and concurrency.
- Package gems, test with RSpec and Minitest, keep quality with RuboCop and types, and understand Rails.
Syllabus
Getting Started with Ruby
- What Ruby Is and Why Developers Love It
- Installing Ruby, irb, Gems and Bundler
- Variables, nil, Strings and Symbols
Control Flow, Collections and Blocks
- Conditionals, case and Ranges
- Arrays, Hashes and Enumerable
- Blocks, yield, Procs and Lambdas
Objects, Classes and Modules
- Classes, Attributes and Initialisation
- Modules, Mixins and Namespaces
- Inheritance, Visibility, Struct and Data
Methods, Errors and Pattern Matching
- Method Arguments and Conventions
- Exceptions and Error Handling
- Pattern Matching with case/in
Dynamic Ruby and Metaprogramming
- Duck Typing, Open Classes and Refinements
- Metaprogramming: send, define_method and method_missing
- Blocks and DSLs
Files, Text and Concurrency
- Files, JSON, CSV and Time
- Strings, Regular Expressions and Encodings
- Threads, the GVL, Fibers and Ractors
Gems, Testing and Code Quality
- Creating and Publishing Gems
- Testing with RSpec and Minitest
- RuboCop, Types and Performance
Rails, Scripting, Idioms and Revision
- A First Look at Ruby on Rails
- Automation, Rake and Command-Line Tools
- Idiomatic Ruby and Common Pitfalls
- Revision and Interview Questions