From: Robert Dober Date: 2008-08-28T00:54:45+09:00 Subject: Re: Difficult Inheritance Problem On Wed, Aug 27, 2008 at 2:55 PM, David A. Black wrote: > Hi -- > > On Wed, 27 Aug 2008, Robert Dober wrote: > >> On Wed, Aug 27, 2008 at 1:37 PM, David A. Black >> wrote: >> Wow that is great, I would call them viral class variables! > > I think class variables are already viral :-) Well they are unique, applying your pattern however the following holds class X < Page @difference_mapping = 42 end Y = Class::new( X ) Y.difference_mapping => 42 *while* Next.difference_mapping is still the hash. ----------------------------------------------------- I meant with viral that the *new* values are propagated *only* down the inheritance tree that is what OP wanted and I have to admit I did not see immediately that your solution was correct in that regard. When I realized how it was I found it quite amazing. I should have said that self.inherited was viral. Cheers Robert