class FriendlyShipping::Services::Ups::SerializeCityStateLookupRequest

Constants

REQUEST_ACTION

Public Class Methods

call(location:) click to toggle source
# File lib/friendly_shipping/services/ups/serialize_city_state_lookup_request.rb, line 9
def self.call(location:)
  xml_builder = Nokogiri::XML::Builder.new do |xml|
    xml.AddressValidationRequest do
      xml.Request do
        xml.RequestAction REQUEST_ACTION
      end
      xml.Address do
        xml.PostalCode location.zip
        xml.CountryCode location.country.code
      end
    end
  end
  xml_builder.to_xml
end