Sha256: 5b935701dbb5cea78d0bfd12047d282801d9045388fe498ddd814b386153b9e8
Contents?: true
Size: 334 Bytes
Versions: 29
Compression:
Stored size: 334 Bytes
Contents
class Array # Returns true if the two arrays elements are equal ignoring order # Example: # [1,2].equivalent([2,1]) # => true # [1,2,3].equivalent([2,1]) # => false def equivalent?(other_array) merged_array = self & other_array merged_array.size == self.size && merged_array.size == other_array.size end end
Version data entries
29 entries across 29 versions & 4 rubygems