From: Joel VanderWerf Date: 2002-11-07T07:24:27+09:00 Subject: Re: class << self ahoward wrote: > rubyists- > > can someone please confirm that this > > class Foo > class << self > def bar > self > end > end > end > > class Bar < Foo > end > > puts Foo.bar # >> Foo > puts Bar.bar # >> Bar > > is the correct way to code an inheritable class method? > > why would > > def Foo.foo > 'foo' > end > > NOT be inherited in this fashion? i understand that the methods are statically > tied to the Foo class object in this case... but it seems like the interpreter > should work around this based on pols? Seems to work for me: puts Bar.foo # ==> 'foo' Or did you mean something else?