From: Robert Dober Date: 2010-05-16T05:41:44+09:00 Subject: Re: Propogate variable up to included module On Sat, May 15, 2010 at 7:24 PM, Intransition wrote: > > > On May 15, 1:05 pm, Robert Dober wrote: >> >> module M>    def self.m >> >      @x ||= 20 >> >    end >> >  end >> >> I do not think this is necessary >> >> >  class X >> >    include M >> >    def self.m >> >      anc = ancestors.find{ |a| a.respond_to?(:m) } >> >      anc.m if anc >> >> replace this with instance_variable_get (potentially guarded by an >> instance_variable_defined?) > > How would that work? > >> I wonder however, what this is good for, I am not sure I understood >> what OP wanted > > Basically class inheritable attributes. > > That's exactly what I gave you, good then :) Cheers R. -- The best way to predict the future is to invent it. -- Alan Kay