On Wed, Nov 16, 2011 at 06:15:33AM +0900, Yossef Mendelssohn wrote: > On Nov 15, 2:14?pm, Jeremy Hinegardner <jer... / hinegardner.org> wrote: > > > > ? ? ? matches = csv.find_all do |row| > > ? ? ? ? match = true > > ? ? ? ? search_criteria.keys.each do |key| > > ? ? ? ? ? match = match && ( row[key] == search_criteria[key] ) > > ? ? ? ? end > > ? ? ? ? match > > ? ? ? end > > search_criteria.all? { |k, v| row[k] == v } > > I actually had to check out Hash#all? to see if it worked the way I > thought. I've never had a reason to use it before. Ah, learning something new, loving it :-). -- ======================================================================== Jeremy Hinegardner jeremy / hinegardner.org