[rspec-users] Testing discovered a problem in my code
mark at mwilden.com
Thu Apr 16 10:52:33 EDT 2009
On Thu, Apr 16, 2009 at 5:46 AM, Matthew Krom <matthew.krom at gmail.com> wrote:
> Also, just noticed your class-caching isn't keyed off user. (I'm also
> honestly not sure what @ instead of @@ means inside a self. class method;
> I'd have to look that up and write specs to test it!)
@var inside a class method is just an instance variable like any
other. There's one for each object instantiated from its class and no
other object can access it. The difference is that in this case, the
object is a class - i.e., it is instantiated from the Class class.
It's call a class instance variable.
@@var is a class variable and can be accessed from both the class
itself and objects instantiated from it.
More information about the rspec-users