Module: Nuggets::Array::RuniqMixin
- Included in:
- Array
- Defined in:
- lib/nuggets/array/runiq_mixin.rb
Instance Method Summary collapse
-
#runiq ⇒ Object
call-seq: array.runiq => an_array.
-
#runiq! ⇒ Object
call-seq: array.runiq! => an_array or
nil.
Instance Method Details
#runiq ⇒ Object
call-seq:
array.runiq => an_array
Reverse #uniq.
36 37 38 |
# File 'lib/nuggets/array/runiq_mixin.rb', line 36 def runiq reverse.uniq.reverse end |
#runiq! ⇒ Object
call-seq:
array.runiq! => an_array or +nil+
Reverse #uniq!.
44 45 46 47 48 49 |
# File 'lib/nuggets/array/runiq_mixin.rb', line 44 def runiq! reverse! res = uniq! reverse! res && self end |