Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/rascut/asdoc/data.rb

Instance Method Summary collapse

Instance Method Details

#uniq_byObject



8
9
10
11
12
13
# File 'lib/rascut/asdoc/data.rb', line 8

def uniq_by
  inject({}) do |hash, item|
    hash[yield(item)] ||= item
    hash
  end.values
end