From: Jano Svitok Date: 2007-06-29T16:53:24+09:00 Subject: Re: include_class,how to define it? On 6/29/07, gz zz wrote: > Hey,I like ruby's mixin with "include" method,now I want to > include_class, > but,how to define it? > thanks > class Module > def include_class(klass) > end > end > > class Foo > def foo > end > end > > > class Bar > include_class Foo > end > > > Bar.new.foo > That's called subclassing, deriving or inheritance. Just do class Bar < Foo end Bar.new.foo Note that you can derive from one class only. All others have to be (included) modules. J.