Class: AtlasEngine::AddressValidation::Validators::FullAddress::UnmatchedFieldConcernBuilder
- Inherits:
-
Object
- Object
- AtlasEngine::AddressValidation::Validators::FullAddress::UnmatchedFieldConcernBuilder
- Extended by:
- T::Sig
- Includes:
- ConcernFormatter
- Defined in:
- app/models/atlas_engine/address_validation/validators/full_address/unmatched_field_concern_builder.rb
Constant Summary collapse
- COMPONENTS_TO_LABELS =
{ zip: "ZIP", province_code: "state", city: "city", street: "street name", }.freeze
- SHORTENED_COMPONENT_NAMES =
{ province_code: :province, }.freeze
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#matched_components ⇒ Object
readonly
Returns the value of attribute matched_components.
-
#message_format ⇒ Object
readonly
Returns the value of attribute message_format.
-
#unmatched_component ⇒ Object
readonly
Returns the value of attribute unmatched_component.
-
#unmatched_field ⇒ Object
readonly
Returns the value of attribute unmatched_field.
Instance Method Summary collapse
- #build(suggestion_ids = []) ⇒ Object
-
#initialize(unmatched_component, matched_components, address, unmatched_field = nil, message_format = MessageFormat::Instructional) ⇒ UnmatchedFieldConcernBuilder
constructor
A new instance of UnmatchedFieldConcernBuilder.
Methods included from ConcernFormatter
Constructor Details
#initialize(unmatched_component, matched_components, address, unmatched_field = nil, message_format = MessageFormat::Instructional) ⇒ UnmatchedFieldConcernBuilder
Returns a new instance of UnmatchedFieldConcernBuilder.
33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unmatched_field_concern_builder.rb', line 33 def initialize( unmatched_component, matched_components, address, unmatched_field = nil, = MessageFormat::Instructional ) @address = address @unmatched_component = unmatched_component @matched_components = matched_components @unmatched_field = unmatched_field || unmatched_component @message_format = end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
11 12 13 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unmatched_field_concern_builder.rb', line 11 def address @address end |
#matched_components ⇒ Object (readonly)
Returns the value of attribute matched_components.
11 12 13 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unmatched_field_concern_builder.rb', line 11 def matched_components @matched_components end |
#message_format ⇒ Object (readonly)
Returns the value of attribute message_format.
11 12 13 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unmatched_field_concern_builder.rb', line 11 def @message_format end |
#unmatched_component ⇒ Object (readonly)
Returns the value of attribute unmatched_component.
11 12 13 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unmatched_field_concern_builder.rb', line 11 def unmatched_component @unmatched_component end |
#unmatched_field ⇒ Object (readonly)
Returns the value of attribute unmatched_field.
11 12 13 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unmatched_field_concern_builder.rb', line 11 def unmatched_field @unmatched_field end |
Instance Method Details
#build(suggestion_ids = []) ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unmatched_field_concern_builder.rb', line 52 def build(suggestion_ids = []) Concern.new( code: code, field_names: field_names, message: , type: T.must(Concern::TYPES[:warning]), type_level: 3, suggestion_ids: suggestion_ids, ) end |