From: Phrogz Date: 2007-03-07T05:55:24+09:00 Subject: Re: remove duplicates of array of object based on a attribute On Mar 6, 1:47 pm, "Phrogz" wrote: > Erik Veenstra wrote: > > And here's the inevitable one-liner... :} > > Not that we're golfing, but I like this one better in terms of one- > linedness: > Hash[ *map{ |o| [ o[:id], o ] }.flatten ].values Oops, I meant: Hash[ *a.map{ |o| [ o[:id], o ] }.flatten ].values