classArray# Return an unique array based on the criteria given as a proc.## [1, 2, 3, 4].uniq_by { |i| i.odd? }# #=> [1, 2]#defuniq_byhash,array={},[]each{|i|hash[yield(i)]||=(array<<i)}arrayend# Same as uniq_by, but modifies self.defuniq_by!replace(uniq_by{|i|yield(i)})endend