From: James Coglan Date: 2008-11-22T02:57:54+09:00 Subject: Re: How to use include? on an array of objects ------=_Part_93815_25679299.1227290076314 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline > > I have the following array: > > [ product1, product2, product3 ] > > All products are of type Product. The Product class defines isntance > attributes such as: title, description, price. > > Can I use include? to check if the array has a product which price is > zero? if not what would I need to do? You probably want any? : product_array.any? { |p| p.price.zero? } ------=_Part_93815_25679299.1227290076314--