From: Jim Freeze Date: 2002-12-13T22:44:34+09:00 Subject: Re: Inheritance Question On Friday, 13 December 2002 at 15:45:27 +0900, Gavin Sinclair wrote: > From: "Jim Freeze" > > > I think for forwarding a whole lot of methods to Matrix, you can use > > require 'delegate' > > MyMatrix = DelegateClass(Matrix) > > class MyMatrix > # Your methods here > end Well, the way Matrix is setup, it makes even using DelegateClass difficult. cat d.rb require 'delegate' require 'matrix' class MyMatrix < DelegateClass(Matrix) def initialize(a) super Matrix[a] end end m = MyMatrix[[1,2],[3,4]] > ruby d.rb d.rb:11: undefined method `[]' for MyMatrix:Class (NameError) -- Jim Freeze ---------- "At least they're EXPERIENCED incompetents"