From: Michael Schuerig Date: 2002-10-15T06:19:46+09:00 Subject: Re: Delegating each Massimiliano Mirra wrote: > On Sun, Oct 13, 2002 at 08:14:20AM +0900, Michael Schuerig wrote: >> Is there a more direct way of implementing each? Is is possible to >> get rid of the each-loop and delegate its behavior to myarray? > > require 'forwardable' > > class C > extend Forwardable > def_delegators(:@myarray, :each) > end That's cool. I didn't even know Forwardable existed. Michael -- Michael Schuerig � � � � � � � � �If at first you don't succeed... mailto:schuerig@acm.org� � � � � �try, try again. http://www.schuerig.de/michael/� �--Jerome Morrow, "Gattaca"