What does @@variable mean in Ruby?
A variable prefixed with @ is an instance variable, while one prefixed with @@ is a class variable. Check out the following example; its output is in the comments at the end of the puts lines: You can see that @@shared is shared between the classes; setting the value in an instance of one changes the value for all other instances of that class and … Read more