method

uniq_by

v3.2.1 - Show latest stable - Class: Array
uniq_by()
public

Returns an unique array based on the criteria given as a Proc.

[1, 2, 3, 4].uniq_by { |i| i.odd? } # => [1, 2]