Class: IdentityParade::Matchers::ArrayMatcher
- Inherits:
-
IdentityParade::Matcher
- Object
- IdentityParade::Matcher
- IdentityParade::Matchers::ArrayMatcher
- Defined in:
- lib/identity_parade/matchers/array_matcher.rb
Overview
This matcher checks the similarity of two arrays. For this purpose, it iterates over all elements and creates a new matcher for every type.
Instance Attribute Summary
Attributes inherited from IdentityParade::Matcher
Instance Method Summary collapse
Methods inherited from IdentityParade::Matcher
Constructor Details
This class inherits a constructor from IdentityParade::Matcher
Instance Method Details
#score ⇒ Object
6 7 8 9 10 11 |
# 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 |