Class: AtlasEngine::AddressValidation::Validators::Predicates::Phone::Valid

Inherits:
AtlasEngine::AddressValidation::Validators::Predicates::Predicate show all
Defined in:
app/models/atlas_engine/address_validation/validators/predicates/phone/valid.rb

Instance Attribute Summary

Attributes inherited from AtlasEngine::AddressValidation::Validators::Predicates::Predicate

#address, #cache, #field, #message_format

Instance Method Summary collapse

Methods inherited from AtlasEngine::AddressValidation::Validators::Predicates::Predicate

#initialize

Constructor Details

This class inherits a constructor from AtlasEngine::AddressValidation::Validators::Predicates::Predicate

Instance Method Details

#evaluateObject



11
12
13
14
15
16
17
18
19
# File 'app/models/atlas_engine/address_validation/validators/predicates/phone/valid.rb', line 11

def evaluate
  return if @address.phone.blank?

  phone = Worldwide::Phone.new(number: @address.phone, country_code: @address.country_code)

  return if phone.valid?

  build_concern
end