From: Shane Emmons Date: 2008-11-22T02:57:16+09:00 Subject: Re: How to use include? on an array of objects ------=_Part_33400_4533643.1227290479191 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Use the 'select' method of array http://ruby-doc.org/core/classes/Array.html#M002214 On Fri, Nov 21, 2008 at 12:44 PM, Fernando Perez wrote: > 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? Iterate over each product and set > a variable if a match is found? > -- > Posted via http://www.ruby-forum.com/. > > -- Shane Emmons ------=_Part_33400_4533643.1227290479191--