Hi,

In message "Re: Class variable and singleton problem"
    on 03/11/11, george.marrows / ps.ge.com <george.marrows / ps.ge.com> writes:

|Any chance you could explain the rationale for this in a bit more detail? I
|thought that class variable look up followed the inheritance hierarchy, not
|the nesting hierarchy. For example:
|
|class A
|	@@x = :a
|end
|
|class B
|	@@x = :b	
|	class C < A
|		def meth
|			@@x
|		end
|	end	
|end
|
|p B::C.new.meth   # => :a   (ruby 1.8.0)

Class variables look up follows the inheritance hierarchy starting
from the nearest class or module.  In this example, look up for @@x in
meth starts from C (nearest class), then A.  The reason is to make
scope resolution as static as possible.

							matz.