Module: Enumerable

Defined in:
lib/omnifocus.rb

Instance Method Summary collapse

Instance Method Details

#uniq_byObject



1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
# File 'lib/omnifocus.rb', line 1066

def uniq_by
  r, s = [], {}
  each do |e|
    v = yield(e)
    next if s[v]
    r << e
    s[v] = true
  end
  r
end