From: Steve Tuckner Date: 2002-11-09T00:02:40+09:00 Subject: Re: Beginner Question (Idiomatic way to subset an array processInfo.select{|x| process['realm'] == realm} -----Original Message----- From: Booth, Peter [mailto:Peter.Booth@gs.com] Sent: Friday, November 08, 2002 8:51 AM To: ruby-talk ML Subject: Beginner Question (Idiomatic way to subset an array I'm wondering if there is a more idiomatic way to do the following? Can Array.collect be used to extract a subset of an array? Peter Can class ProcessInfo < Array def findByRealm(realm) result = ProcessInfo.new each { |process| if process['realm'] == realm result << process end } return result end end