Sha256: bf08d6ab7a1126e922c2b7841dfc015edaf652134b1ce09c348469240b97dc7b

Contents?: true

Size: 677 Bytes

Versions: 4

Compression:

Stored size: 677 Bytes

Contents

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

4 entries across 4 versions & 1 rubygems

Version Path
mws-orders-0.2.1 lib/mws/orders/shipping_address.rb
mws-orders-0.2.0 lib/mws/orders/shipping_address.rb
mws-orders-0.1.1 lib/mws/orders/shipping_address.rb
mws-orders-0.1.0 lib/mws/orders/shipping_address.rb