module Enumerable

Public Instance Methods

uniq_by() { |e| ... } click to toggle source
# File lib/omnifocus.rb, line 879
def uniq_by
  r, s = [], {}
  each do |e|
    v = yield(e)
    next if s[v]
    r << e
    s[v] = true
  end
  r
end