Showing posts with label naming convention. Show all posts
Showing posts with label naming convention. Show all posts

Tuesday, 13 October 2015

Ruby variable names convention

The first characters of a name indicate how the name is used. 

lowercase letter : Local variables, method parameters, and method names 

uppercase letter: class names, module names, and constants

Prefixes:

global variables : $

instance variables : @

class variables : @@

As no variable may begin with a digit, no digit can follow immediately after a $ @ or @@ prefix