From: Leo Date: 2009-03-02T17:18:34+09:00 Subject: Re: Delegating class methods > BTW, there's some glitch here. Let's say you inherit from Foo: I'm not sure this can really be called a glitch because that's simply the way self.instance-variables (or whatever their correct name is) work. One solution would be to create a inherited class method that copies the variables from the super class to the subclass. class Foo @one = 1 @two = 2 @three = 3 class << self attr_accessor :one, :two, :three def inherited(sub) sub.one = one sub.two = two sub.three = three end end end class Momo < Foo end Momo.one #=> 1 That's cumbersome of course and it would be great if ruby had a construct to do this automatically with having to define an inherited hook. -- Leo The end is here -->