Variables, Misc
- Variables are references to objects
- Variable declarations are not needed
- Undefined value for a variable: nil
- Integers can be used without having to
worry about their
internal representation (size); automatically converted as needed
Prefixes
- Local variable:
myVar
- Global Variable:
$myVar
- Instance variable:
@myVar
- Class variable:
@@myVar
- Default global variable:
$_
- Global variable for raised exception: $!
Case
- Local variables, methods, and method
parameters should start with a lowercase letter or with an
underscore
- Classes, modules, and
constants should start with an uppercase letter