From: Logan Capaldo Date: 2007-05-02T08:11:04+09:00 Subject: Re: simple subclass question ------=_Part_117339_31756813.1178061062277 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 5/1/07, Ball, Donald A Jr (Library) wrote: > > > class A > class << self > @var = 'foo' > attr_accessor :var > end > end > > to no avail. Also tried doing it in an initialize method. I'm still > missing something key, I think. class A @var = 'foo' class << self attr_accessor :var end end (warning, the following explanation is not really correct) class << self is sort of A's class (the class of the class) (It's actually A's singleton class). By putting @var='foo' inside class << self you set the class of A's instance var @var to 'foo' not A's @var to foo. - donald > > ------=_Part_117339_31756813.1178061062277--