Overview
Ruby is a dynamic, open-source language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. Everything in Ruby is an object. Ruby on Rails, the web framework that popularized Ruby, introduced conventions like MVC and "convention over configuration" that influenced web development across all languages.
Key Features
- Everything is an object — Even numbers and nil are objects with methods
- Blocks & procs — First-class closures enabling elegant DSLs
- Metaprogramming — Runtime class modification and method_missing
- Gems ecosystem — RubyGems.org hosts thousands of libraries
- Convention over configuration — Rails philosophy minimizes boilerplate
Code Example
ruby
Learning Resources
Learning Path
14 topics across 4 sections
1Basics
- Introduction to Ruby — IRB, RubyGems, and the Ruby philosophy
- Variables & Types — Dynamic typing, symbols, strings, numbers, and nil
- Control Flow — if/unless, case/when, while/until, and ternary
- Methods — def, return values, default params, and variadic args (*)
2Collections & Iteration
- Arrays — Creation, slicing, map, select, reject, flatten
- Hashes — Symbol keys, default values, merge, and transform
- Blocks, Procs & Lambdas — yield, Proc.new, lambda, and the block/proc distinction
- Enumerable — each, map, reduce, group_by, and lazy enumerators
3OOP
- Classes & Modules — attr_accessor, initialize, inheritance, and mixins
- Metaprogramming — method_missing, define_method, and open classes
- Patterns — Duck typing, convention over configuration, and DSLs
4Ruby on Rails
- MVC Architecture — Models, views, controllers, and the Rails request cycle
- Active Record — ORM, migrations, validations, and associations
- Testing — RSpec, Minitest, FactoryBot, and TDD practices