From: Joel VanderWerf Date: 2002-07-16T07:47:06+09:00 Subject: Re: cut & paste for code Matthias Veit wrote: > What i want to achieve is described best with "copy inheritance" > - no real inheritance, more like copy the source code from one > class to another (as easy as in every editor). > The call T::B.new.a shall return a T::A not an R::A. Does this work for you? module MA end module MB def a return type::A.new end end module R class A include MA end class B A = R::A include MB end end module T class A include MA end class B A = T::A include MB end end p R::B.new.a.type # prints: R::A p T::B.new.a.type # prints: T::A