Class: AtlasEngine::AddressValidation::Validators::Predicates::Zip::ValidForProvince
- Inherits:
-
ZipBase
- Object
- Predicate
- ZipBase
- AtlasEngine::AddressValidation::Validators::Predicates::Zip::ValidForProvince
- Defined in:
- app/models/atlas_engine/address_validation/validators/predicates/zip/valid_for_province.rb
Instance Attribute Summary
Attributes inherited from Predicate
#address, #cache, #field, #message_format
Instance Method Summary collapse
Methods inherited from Predicate
Constructor Details
This class inherits a constructor from AtlasEngine::AddressValidation::Validators::Predicates::Predicate
Instance Method Details
#concerning? ⇒ Boolean
16 17 18 19 20 21 22 23 24 25 |
# File 'app/models/atlas_engine/address_validation/validators/predicates/zip/valid_for_province.rb', line 16 def concerning? return false unless super return false if @address.zip.blank? return false if @cache.country.hide_provinces_from_addresses return false if @address.province_code.blank? return false unless @cache.province.province? return false if @cache.province.valid_zip?(@address.zip) true end |
#evaluate ⇒ Object
11 12 13 |
# File 'app/models/atlas_engine/address_validation/validators/predicates/zip/valid_for_province.rb', line 11 def evaluate build_concern if concerning? end |