Possible Duplicate:
What does @@variable mean in Ruby?
What is the difference when I declare an object with double ‘@’
@@lexicon = Lexicon.new()
and declaring object with single ‘@’ in Ruby?
@lexicon = Lexicon.new()
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The difference is that the first one is a class variable and the second one is an instance variable.
An instance variable is only available to that instance of an object. i.e.
A class variable is available to all instances of the class (and subclasses, iirc) where the class variable was defined.