class IdentityParade::Matchers::ArrayMatcher

This matcher checks the similarity of two arrays. For this purpose, it iterates over all elements and creates a new matcher for every type.

Public Instance Methods

score() click to toggle source
# File lib/identity_parade/matchers/array_matcher.rb, line 6
def score
  return if left.empty?
  return 0 unless right.is_a? Array

  1 - ((left - right).size / left.size.to_f)
end