Class: AtlasEngine::AddressValidation::Validators::FullAddress::UnknownAddressConcernBuilder
- Inherits:
-
Object
- Object
- AtlasEngine::AddressValidation::Validators::FullAddress::UnknownAddressConcernBuilder
- Extended by:
- T::Sig
- Includes:
- ConcernFormatter
- Defined in:
- app/models/atlas_engine/address_validation/validators/full_address/unknown_address_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) ⇒ UnknownAddressConcernBuilder
constructor
A new instance of UnknownAddressConcernBuilder.
Methods included from ConcernFormatter
Constructor Details
#initialize(address, message_format = MessageFormat::Instructional) ⇒ UnknownAddressConcernBuilder
Returns a new instance of UnknownAddressConcernBuilder.
19 20 21 22 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unknown_address_concern_builder.rb', line 19 def initialize(address, = MessageFormat::Instructional) @address = address @message_format = end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
13 14 15 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unknown_address_concern_builder.rb', line 13 def address @address end |
#message_format ⇒ Object (readonly)
Returns the value of attribute message_format.
16 17 18 |
# File 'app/models/atlas_engine/address_validation/validators/full_address/unknown_address_concern_builder.rb', line 16 def @message_format end |
Instance Method Details
#build(suggestion_ids = []) ⇒ Object
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_address_concern_builder.rb', line 25 def build(suggestion_ids = []) = country.field(key: :address).error( code: "may_not_exist_#{.serialize}".to_sym, ).to_s Concern.new( code: :address_unknown, message: , type: T.must(Concern::TYPES[:warning]), type_level: 1, suggestion_ids: suggestion_ids, field_names: [field], ) end |