Method: AtlasEngine::ValidationTranscriber::ZipNormalizer.normalize
- Defined in:
- app/lib/atlas_engine/validation_transcriber/zip_normalizer.rb
.normalize(country_code:, zip:) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'app/lib/atlas_engine/validation_transcriber/zip_normalizer.rb', line 11 def normalize(country_code:, zip:) if country_code.present? && Worldwide.region(code: country_code).valid_zip?(zip) AddressValidation::ZipTruncator.new(country_code: country_code).truncate( zip: Worldwide::Zip.normalize(country_code: country_code, zip: zip, strip_extraneous_characters: true), ) else Worldwide::Zip.normalize(country_code: country_code, zip: zip) end end |