Class: AtlasEngine::AddressValidation::Validators::FullAddress::UnknownProvinceConcernBuilder
- Inherits:
-
Object
- Object
- AtlasEngine::AddressValidation::Validators::FullAddress::UnknownProvinceConcernBuilder
- Extended by:
- T::Sig
- Includes:
- ConcernFormatter
- Defined in:
- app/models/atlas_engine/address_validation/validators/full_address/unknown_province_concern_builder.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#message_format ⇒ Object
readonly
Returns the value of attribute message_format.
Instance Method Summary collapse
- #build(suggestion_ids = []) ⇒ Object
-
#initialize(address, message_format = MessageFormat::Instructional) ⇒ UnknownProvinceConcernBuilder
constructor
A new instance of UnknownProvinceConcernBuilder.
Methods included from ConcernFormatter
Constructor Details
#initialize(address, message_format = MessageFormat::Instructional) ⇒ UnknownProvinceConcernBuilder
Returns a new instance of UnknownProvinceConcernBuilder.
18 19 20 21 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unknown_province_concern_builder.rb', line 18 def initialize(address, = MessageFormat::Instructional) @address = address @message_format = end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
12 13 14 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unknown_province_concern_builder.rb', line 12 def address @address end |
#message_format ⇒ Object (readonly)
Returns the value of attribute message_format.
15 16 17 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unknown_province_concern_builder.rb', line 15 def @message_format end |
Instance Method Details
#build(suggestion_ids = []) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unknown_province_concern_builder.rb', line 24 def build(suggestion_ids = []) = country.field(key: :province).error( code: "unknown_for_city_and_zip_#{.serialize}".to_sym, options: { city: address.city, zip: address.zip }, ).to_s Concern.new( code: :province_inconsistent, field_names: [:province], message: , type: T.must(Concern::TYPES[:error]), type_level: 1, suggestion_ids: suggestion_ids, ) end |