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