From: James Edward Gray II Date: 2006-07-12T04:41:55+09:00 Subject: Re: blocks and procs On Jul 11, 2006, at 2:31 PM, Dark Ambient wrote: > hmmmm....i have that code in there: > >> def select( query ) >> # parse query String >> rules = Hash[*query.split(/\s*AND\s*/).map do |rule| >> rule.split(/\s*=\s*/).map { |value| value.sub(/^['"](.+) >> ['"]$/, >> '\1') } end.flatten ] >> >> #match records >> @records.select { |record| block_given? and yield record } >> rules.all? { |field, value| record.send(field) == value } >> >> >> end # end of method >> >> end # end of class That's from higher up in the article. Here's the one just before the example you showed: class ClientDB def select @records.select { |record| block_given? and yield record } end end Try that. James Edward Gray II