From: Robert Dober Date: 2008-12-02T02:52:19+09:00 Subject: Re: How do you find an item that satisfies multiple conditions? On Mon, Dec 1, 2008 at 1:40 PM, Chad Fowler wrote: > Hi Bob. The find method returns a new collection including all > elements for which the block returns boolean true. I am afraid that you confused Enumerable#find with Enumerable#select 616/137 > ruby -e 'p [*0..9].find{|x| (x%2).zero? }' 0 617/138 > ruby -e 'p [*0..9].select{|x| (x%2).zero? }' [0, 2, 4, 6, 8] robert@siena:~/log/ruby 18:56:47 618/139 > ruby -e 'p [*0..9].select{|x| (x%2).zero? && (x%3).zero?}' [0, 6] HTH Robert -- Ne baisse jamais la tête, tu ne verrais plus les étoiles. Robert Dober ;)