From: Tobias Reif Date: 2001-08-20T23:09:20+09:00 Subject: [ruby-talk:20023] Re: problem understanding class relationships I wrote: > >Thus all classes are in the same family > >and thus @@ variables would be shared among all objects. > > > >Where am I erring? Yukihiro Matsumoto wrote: > Like constants, class variables must be assigned at the class/module > top level, and shared among its subclasses. > > class Foo > @@foo = 43 # @@foo is assigned (declared) here. > end > > class Bar def bar > p @@foo # @@foo is available. > end > end > > class Baz def baz > p @@foo # @@foo is NOT available here. > end > end Is the following possible? class Foo