Class: AtlasEngine::AddressImporter::Validation::DefaultValidator

Inherits:
BaseValidator
  • Object
show all
Extended by:
T::Sig
Defined in:
app/models/atlas_engine/address_importer/validation/default_validator.rb

Constant Summary

Constants inherited from BaseValidator

BaseValidator::Errors

Instance Attribute Summary

Attributes inherited from BaseValidator

#additional_field_validations, #allow_partial_zip, #field_validations

Instance Method Summary collapse

Methods inherited from BaseValidator

#validation_errors

Constructor Details

#initialize(country_code:) ⇒ DefaultValidator

Returns a new instance of DefaultValidator.



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/models/atlas_engine/address_importer/validation/default_validator.rb', line 11

def initialize(country_code:)
  field_validations = {
    city: [FieldValidations::City],
    province_code: [FieldValidations::Province],
    zip: [FieldValidations::Zip],
  }

  super(
    country_code: country_code,
    field_validations: field_validations,
    additional_field_validations: AtlasEngine.address_importer_additional_field_validations,
  )
end