Module: Nuggets::Array::RuniqMixin

Included in:
Array
Defined in:
lib/nuggets/array/runiq_mixin.rb

Instance Method Summary collapse

Instance Method Details

#runiqObject

call-seq:

array.runiq => an_array

Reverse #uniq.



35
36
37
# File 'lib/nuggets/array/runiq_mixin.rb', line 35

def runiq
  reverse.uniq.reverse
end

#runiq!Object

call-seq:

array.runiq! => an_array or +nil+

Reverse #uniq!.



43
44
45
46
47
48
# File 'lib/nuggets/array/runiq_mixin.rb', line 43

def runiq!
  reverse!
  res = uniq!
  reverse!
  res && self
end