Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/trackman/utility/core_extensions.rb

Instance Method Summary collapse

Instance Method Details

#uniqObject



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/trackman/utility/core_extensions.rb', line 28

def uniq
  ret, keys = [], []
  each do |x|
    key = block_given? ? yield(x) : x
    unless keys.include? key
      ret << x
      keys << key
    end
  end
  ret
end