There are several types of variables in Ruby:
- Global variables - these begin with a $. However, these are generally not recommended as they make a program difficult to read, understand and debug.
- Instance variables - these begin with an @ symbol.
- Class variables - these begin with an @@ symbol.