Language
Version: 2.2.0
Categories
-
User Program Communication
-
Variables
-
Control Flow
-
Functions and Blocks
-
Object Oriented Programming
Variables
Local Variable Declaration in Ruby
Used to declare a variable outside of a class.
Syntax
#local variable
variableName = value
#for class variables, look at the class and instance variables topic
Notes
Variables in Ruby are dynamically typed, which means no type is assigned to the variable.
All variables in Ruby are objects, which means methods can be invoked from the variable. In fact, everything in Ruby is an object.
Example
name = "Anthony"