Sha256: ab20fdb7443b4508f0fb79fb9325018837439c8411cd47c23a30b272413c1af6

Contents?: true

Size: 963 Bytes

Versions: 1

Compression:

Stored size: 963 Bytes

Contents

# frozen_string_literal: true

module FriendlyShipping
  module Services
    class ShipEngine
      class SerializeAddressValidationRequest
        class << self
          # @param location [Physical::Location]
          # @return [Array<Hash>]
          def call(location:)
            [
              {
                name: location.name,
                phone: location.phone,
                email: location.email,
                company_name: location.company_name,
                address_line1: location.address1,
                address_line2: location.address2,
                address_line3: location.address3,
                city_locality: location.city,
                state_province: location.region&.code,
                postal_code: location.zip,
                country_code: location.country&.code
              }.merge(SerializeAddressResidentialIndicator.call(location))
            ]
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
friendly_shipping-0.9.0 lib/friendly_shipping/services/ship_engine/serialize_address_validation_request.rb