Sha256: ba5a8e1e12cb1a7288cb068c1afdaa37a738160c6bb36cb59aa02f9fc0e1ef01

Contents?: true

Size: 708 Bytes

Versions: 3

Compression:

Stored size: 708 Bytes

Contents

# frozen_string_literal: true

require 'mws/orders/entity'

module MWS
  module Orders
    class ShippingAddress < Entity
      attribute(:name) do
        text_at_xpath('Name')
      end

      attribute(:address_lines) do
        1.upto(3).map { |i| text_at_xpath("AddressLine#{i}") }.compact
      end

      attribute(:city) do
        text_at_xpath('City')
      end

      attribute(:state_or_region) do
        text_at_xpath('StateOrRegion')
      end

      attribute(:postal_code) do
        text_at_xpath('PostalCode')
      end

      attribute(:country_code) do
        text_at_xpath('CountryCode')
      end

      attribute(:phone) do
        text_at_xpath('Phone')
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mws-orders-0.4.0 lib/mws/orders/shipping_address.rb
mws-orders-0.3.1 lib/mws/orders/shipping_address.rb
mws-orders-0.3.0 lib/mws/orders/shipping_address.rb