Definition: To declare a variable in Ruby is to first refer to it. Many languages require formal declarations before a variable can be used, but in Ruby, you must simply assign a value to the variable to begin using it. To declare a variable in Ruby, you simply begin using it. Something akin to a formal declaration is needed to declare a method in Ruby. The def keyword begins such a formal declaration, defining the method name, parameters and body.
Also Known As: Define, Allocate