Class: AtlasEngine::AddressValidation::Validators::FullAddress::RelevantComponents
- Inherits:
-
Object
- Object
- AtlasEngine::AddressValidation::Validators::FullAddress::RelevantComponents
- Extended by:
- T::Sig
- Defined in:
- app/models/atlas_engine/address_validation/validators/full_address/relevant_components.rb
Instance Attribute Summary collapse
-
#address_comparison ⇒ Object
readonly
Returns the value of attribute address_comparison.
-
#candidate ⇒ Object
readonly
Returns the value of attribute candidate.
Instance Method Summary collapse
- #components_to_compare ⇒ Object
- #components_to_validate ⇒ Object
-
#initialize(address_comparison, matching_strategy) ⇒ RelevantComponents
constructor
A new instance of RelevantComponents.
Constructor Details
#initialize(address_comparison, matching_strategy) ⇒ RelevantComponents
Returns a new instance of RelevantComponents.
23 24 25 26 27 28 29 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/relevant_components.rb', line 23 def initialize(address_comparison, matching_strategy) @address_comparison = address_comparison @matching_strategy = matching_strategy @address = address_comparison.address @candidate = address_comparison.candidate @all_supported_components = address_comparison.relevant_components.dup end |
Instance Attribute Details
#address_comparison ⇒ Object (readonly)
Returns the value of attribute address_comparison.
15 16 17 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/relevant_components.rb', line 15 def address_comparison @address_comparison end |
#candidate ⇒ Object (readonly)
Returns the value of attribute candidate.
12 13 14 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/relevant_components.rb', line 12 def candidate @candidate end |
Instance Method Details
#components_to_compare ⇒ Object
40 41 42 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/relevant_components.rb', line 40 def components_to_compare @all_supported_components.dup - unsupported_components_for_country end |
#components_to_validate ⇒ Object
32 33 34 35 36 37 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/relevant_components.rb', line 32 def components_to_validate supported_components = @all_supported_components.dup - unsupported_components_for_country apply_exclusions(supported_components) supported_components.delete(:street) if exclude_street_validation? supported_components end |