Class: AtlasEngine::AddressValidation::Address

Inherits:
T::Struct
  • Object
show all
Extended by:
T::Sig
Includes:
AbstractAddress, LogHelper
Defined in:
app/models/atlas_engine/address_validation/address.rb

Constant Summary collapse

ComponentType =
T.type_alias { T.nilable(String) }
CountryType =
T.type_alias { T.nilable(T.any(String, Symbol)) }
AddressInput =
T.type_alias { Types::AddressValidation::AddressInput }

Class Method Summary collapse

Instance Method Summary collapse

Methods included from AbstractAddress

#[], #address1, #address2, #city, #country_code, #keys, #line2, #neighborhood, #phone, #province_code, #street_name, #street_number, #zip

Methods included from LogHelper

#log_error, #log_info, #log_warn

Class Method Details

.from_address(address:) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'app/models/atlas_engine/address_validation/address.rb', line 37

def from_address(address:)
  new(
    address1: address.address1,
    street_name: address.street_name,
    street_number: address.street_number,
    address2: address.address2,
    line2: address.line2,
    neighborhood: address.neighborhood,
    city: address.city,
    country_code: address.country_code,
    province_code: address.province_code,
    zip: address.zip,
    phone: address.phone,
  )
end

Instance Method Details

#contextObject



28
# File 'app/models/atlas_engine/address_validation/address.rb', line 28

def context = {}

#to_hObject



31
# File 'app/models/atlas_engine/address_validation/address.rb', line 31

def to_h = serialize.transform_keys(&:to_sym)