From: Milo Thurston Date: 2007-08-09T20:00:05+09:00 Subject: Re: Collect objects from an array based on one unique parame Robert Klemme wrote: > selection = things.select {|x| x.name = "foo"} That is closer, but still not quite it. A slight change of my previously posted code may make it clearer. In this case I start with an array of "Thing" objects called "things", and would like an array called "uniquely_named_things" containing Things where the name is unique. check = Hash.new uniquely_named_things = Array.new things.each do |s| if check[s.name].nil? uniquely_named_things << s end check[s.name] = 1 end Basically, I wonder if anything that does the same as this has already been included in Ruby. -- Posted via http://www.ruby-forum.com/.