Rb

Ruby

beginner

A programmer's best friend.

Ruby is a dynamic, open source programming language with a focus on simplicity and productivity. It has an elegant syntax that is natural to read and easy to write. Often associated with the Ruby on Rails web framework.

Web DevelopmentAutomationDevOpsPrototyping
0%
0/11 lessons

Setup

Ruby is best installed using a version manager like rbenv or rvm on Unix-like systems. On Windows, use RubyInstaller.

Bash
# Download and run RubyInstaller from rubyinstaller.org
# Choose the version with MSYS2/MINGW development toolchain (DevKit).

# Verify:
ruby -v
gem -v

Lessons

1
Hello, Ruby!
Ruby is famous for developer happiness. Matz (Ruby's creator) has said the langu
2
Variables & Types
Ruby is dynamically typed with a twist: everything is an object. Not almost ever
3
Control Flow
Ruby's control flow reads like English prose. `unless` is `if not`. `until` is `
4
Methods
In Ruby, methods are defined with `def`. They implicitly return the last express
5
Arrays, Hashes & Ranges
Ruby's collection classes are loaded with useful methods. You'll rarely need to
6
Strings & Regex
Ruby's String class has over 100 methods. This is either brilliant or insane, bu
7
Classes & OOP
Ruby's OOP is clean and expressive. Everything is an object, inheritance is sing
8
Modules & Mixins
Ruby solves the multiple-inheritance problem with modules. You `include` a modul
9
Error Handling
Ruby calls exceptions exceptions. `begin/rescue/ensure` is Ruby's try/catch/fina
10
Mini Project: CLI Password Generator
Let's build a command-line password generator. It'll use modules, classes, strin
11
Ruby Cheatsheet
Syntax, blocks, collections, and classes on one page.