From: Brian Candler Date: 2007-02-09T21:06:38+09:00 Subject: Re: What is really a class instance variable compare to a class variable ? On Fri, Feb 09, 2007 at 07:48:37PM +0900, Ruby Admirer wrote: > => So, an object instance variable is shared/seen by the derived object instances. My understanding is: (1) An instance variable is only visible to that object. It doesn't matter what "class" the object is. It's not visible by any other objects, either of the same class or a different class. (2) A class instance variable is an instance variable of an object which happens to be a class (its an object whose class is "Class"). This is also private to that object, i.e. to the class. A subclass is a different object, so has its own class instance variables. (3) Class variables, i.e. @@foo, are voodoo. But yes I believe they are shared by groups of classes in the same ancestry somehow. B.