Ruby: Variables and Math

There are several types of variables in Ruby:

  1. Global variables - these begin with a $. However, these are generally not recommended as they make a program difficult to read, understand and debug.
  2. Instance variables - these begin with an @ symbol.
  3. Class variables - these begin with an @@ symbol.