class Array
Additional useful methods to extend the Array
class with
Public Instance Methods
non_uniq()
click to toggle source
@return [Array]
Return the non-unique items of an array
# File lib/automation_helpers/extensions/array.rb, line 15 def non_uniq tally.select { |_key, count| count > 1 }.map(&:first) end
uniq?()
click to toggle source
@return [Boolean]
Test whether an array is wholly unique
# File lib/automation_helpers/extensions/array.rb, line 8 def uniq? uniq == self end