From: Stefano Crocco Date: 2008-12-01T21:41:52+09:00 Subject: Re: How do you find an item that satisfies multiple conditions? Alle Monday 01 December 2008, Bob Sanders ha scritto: > I know that to find an item that satisfies one condition, it's this: > > @items.find {|item| item.product == product } > > I thought I could try this to check that an item satisfies multiple > conditions: > > @items.find {|item| > item.product == product > item.red == red > item.blue == blue > } > > Of course, I'm not getting desirable results from that. Do you know how > I would correctly find an item that satisfies multiple conditions? @items.find{|item| item.product == product && item.red == red && item.blue == blue} Stefano