Class: AtlasEngine::AddressValidation::Validators::FullAddress::InvalidZipForProvinceConcernBuilder
- Inherits:
-
Object
- Object
- AtlasEngine::AddressValidation::Validators::FullAddress::InvalidZipForProvinceConcernBuilder
- Extended by:
- T::Sig
- Includes:
- ConcernFormatter
- Defined in:
- app/models/atlas_engine/address_validation/validators/full_address/invalid_zip_for_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) ⇒ InvalidZipForProvinceConcernBuilder
constructor
A new instance of InvalidZipForProvinceConcernBuilder.
Methods included from ConcernFormatter
Constructor Details
#initialize(address, message_format) ⇒ InvalidZipForProvinceConcernBuilder
Returns a new instance of InvalidZipForProvinceConcernBuilder.
14 15 16 17 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/invalid_zip_for_province_concern_builder.rb', line 14 def initialize(address, ) @address = address @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/invalid_zip_for_province_concern_builder.rb', line 11 def address @address end |
#message_format ⇒ Object (readonly)
Returns the value of attribute message_format.
12 13 14 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/invalid_zip_for_province_concern_builder.rb', line 12 def @message_format end |
Instance Method Details
#build(suggestion_ids = []) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/invalid_zip_for_province_concern_builder.rb', line 20 def build(suggestion_ids = []) = country.field(key: :zip).error( code: "invalid_for_province_#{.serialize}".to_sym, options: { province: province_name }, ).to_s Concern.new( field_names: [:zip], code: :zip_invalid_for_province, type: T.must(Concern::TYPES[:error]), type_level: 1, suggestion_ids: suggestion_ids, message: , ) end |