Class: AtlasEngine::AddressValidation::Validators::FullAddress::StreetComparison
- Inherits:
-
FieldComparisonBase
- Object
- FieldComparisonBase
- AtlasEngine::AddressValidation::Validators::FullAddress::StreetComparison
show all
- Extended by:
- T::Sig
- Defined in:
- app/models/atlas_engine/address_validation/validators/full_address/street_comparison.rb
Instance Attribute Summary
#component
Instance Method Summary
collapse
#initialize, #match?
Instance Method Details
#relevant? ⇒ Boolean
12
13
14
|
# File 'app/models/atlas_engine/address_validation/validators/full_address/street_comparison.rb', line 12
def relevant?
true
end
|
#sequence_comparison ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'app/models/atlas_engine/address_validation/validators/full_address/street_comparison.rb', line 17
def sequence_comparison
return @street_comparison if defined?(@street_comparison)
street_sequences = datastore.fetch_street_sequences
candidate_sequences = T.must(candidate.component(:street)).sequences
@street_comparison = street_sequences.map do |street_sequence|
best_comparison(
street_sequence,
candidate_sequences,
field_policy(:street),
)
end.min
end
|