From: Toby Rodwell Date: 2010-05-14T19:47:31+09:00 Subject: Comparing elements within an array I'm familiar with the enumberable sort method ... my_array.sort { |a,b| a.property <=> b.property } and I'm familiar with reject and delete_if methods ... my_array.delete_if { |a| } but can someone advise me on a simple way to compare elements within an array and delete one if a certain property is the same as another element e.g. my_array.special_delete_if { |a,b| a.property == b.property } Note, the reason I can't just use my_array.uniq is that the array is made up of objects which are themselves unique, it is just that some elements share the same property (and these are the ones I want to collapse down to just one object). Thanks in advance! -- Posted via http://www.ruby-forum.com/.