From: Milo Thurston Date: 2007-08-09T21:20:40+09:00 Subject: Re: Collect objects from an array based on one unique parame unknown wrote: > Sorry -- s/Miles/Milo/ No problem - it happens all the time. selection = things.inject({}) {|h,th| h[th.name] ||= th; h}.values ...looks like what I was after, thanks, allowing everything to be done in one line. I had not heard of inject, so that is generally useful to know. -- Posted via http://www.ruby-forum.com/.