From: Iain Barnett Date: 2010-07-17T04:27:11+09:00 Subject: Re: Recurse through array of arrays On 16 Jul 2010, at 15:23, Jeff Moore wrote: > Jeff Moore wrote: >> Iain Barnett wrote: >>> On 16 Jul 2010, at 13:07, Iain Barnett wrote: >>>> >>>> >>>> Each object 't' ... >>> >>> Pardon me, 't' is the instance of the object here, if that wasn't clear. >>> >>> >>> Iain >> >> result = t.flatten.select { |e| e.whatever_attr == "anything" } > > oh yes.. > > should specify some max_depth for flatten > > max_depth = 99 > result = t.flatten(max_depth).select { |e| e.whatever_attr == "anything" > } > -- > Posted via http://www.ruby-forum.com/. > Thanks very much. Can't argue with a 12 line into 2 line reduction! :) Iain