Class: AtlasEngine::AddressImporter::Validation::FieldValidations::Zip

Inherits:
Object
  • Object
show all
Extended by:
T::Helpers, T::Sig
Includes:
Interface
Defined in:
app/models/atlas_engine/address_importer/validation/field_validations/zip.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(address:, allow_partial_zip: false) ⇒ Zip

Returns a new instance of Zip.



21
22
23
24
25
26
27
# File 'app/models/atlas_engine/address_importer/validation/field_validations/zip.rb', line 21

def initialize(address:, allow_partial_zip: false)
  @country_code = address.country_code
  @province_code = address.province_code
  @zip = address.zip
  @allow_partial_zip = allow_partial_zip
  @errors = []
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



13
14
15
# File 'app/models/atlas_engine/address_importer/validation/field_validations/zip.rb', line 13

def errors
  @errors
end

Instance Method Details

#validation_errorsObject



30
31
32
33
# File 'app/models/atlas_engine/address_importer/validation/field_validations/zip.rb', line 30

def validation_errors
  validate
  errors
end