Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/core_ext/array.rb
Instance Method Summary collapse
Instance Method Details
#uniq_by ⇒ Object
2 3 4 5 6 |
# File 'lib/core_ext/array.rb', line 2 def uniq_by hash, array = {}, [] each { |i| hash[yield(i)] ||= (array << i) } array end |