Class: AtlasEngine::AddressImporter::Validation::FieldValidations::Province
- Inherits:
-
Object
- Object
- AtlasEngine::AddressImporter::Validation::FieldValidations::Province
- Extended by:
- T::Helpers, T::Sig
- Includes:
- Interface
- Defined in:
- app/models/atlas_engine/address_importer/validation/field_validations/province.rb
Instance Attribute Summary collapse
-
#country_code ⇒ Object
readonly
Returns the value of attribute country_code.
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
-
#province_code ⇒ Object
readonly
Returns the value of attribute province_code.
Instance Method Summary collapse
-
#initialize(address:, allow_partial_zip: false) ⇒ Province
constructor
A new instance of Province.
- #validation_errors ⇒ Object
Constructor Details
#initialize(address:, allow_partial_zip: false) ⇒ Province
Returns a new instance of Province.
29 30 31 32 33 |
# File 'app/models/atlas_engine/address_importer/validation/field_validations/province.rb', line 29 def initialize(address:, allow_partial_zip: false) @country_code = address.country_code @province_code = address.province_code @errors = [] end |
Instance Attribute Details
#country_code ⇒ Object (readonly)
Returns the value of attribute country_code.
15 16 17 |
# File 'app/models/atlas_engine/address_importer/validation/field_validations/province.rb', line 15 def country_code @country_code end |
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
21 22 23 |
# File 'app/models/atlas_engine/address_importer/validation/field_validations/province.rb', line 21 def errors @errors end |
#province_code ⇒ Object (readonly)
Returns the value of attribute province_code.
18 19 20 |
# File 'app/models/atlas_engine/address_importer/validation/field_validations/province.rb', line 18 def province_code @province_code end |
Instance Method Details
#validation_errors ⇒ Object
36 37 38 39 40 |
# File 'app/models/atlas_engine/address_importer/validation/field_validations/province.rb', line 36 def validation_errors validate_country validate_province if errors.empty? errors end |