-2

I produce an app with ruby, and benefited from ruby tutorials. So, I meet this syntax (@@vars), and want to ask it. (I think it's like a pointer in C or two dimensional array)

@@vars AND @vars

Andrew Grimm
  • 78,473
  • 57
  • 200
  • 338
Hakan Ilgar
  • 141
  • 5
  • 14
  • possible duplicate of [What does @@variable mean in Ruby?](http://stackoverflow.com/questions/5890118/what-does-variable-mean-in-ruby) – Andrew Grimm Jan 11 '12 at 10:57

1 Answers1

5

@var is an instance variable, whereas @@var is a class variable. See for example:

http://railstips.org/blog/archives/2006/11/18/class-and-instance-variables-in-ruby/

Michael Kohl
  • 66,324
  • 14
  • 138
  • 158