Ruby Cheatsheet
Ruby Cheatsheet
Variables
Variable names use underscores between words for complex names
Conditional Tests (if)
Place if
, elsif
, else
, and end
on separate lines.
Operators
Method Calls
Parentheses are optional, but make method calls more readable.
Method Definitions
Methods can return values which can be assigned to a variable.
Hashes
Hashes hold objects and are referenced by their key
assignment.
Arrays
Arrays hold objects and are referenced by their position, starting with
position 0
.
Iterators
Iterators allow you to repeat an action.