class Newgistics::ResponseHandlers::UpdateShipmentAddress

Attributes

shipment_address_update[R]

Public Class Methods

new(shipment_address_update) click to toggle source
# File lib/newgistics/response_handlers/update_shipment_address.rb, line 6
def initialize(shipment_address_update)
  @shipment_address_update = shipment_address_update
end

Public Instance Methods

handle(response) click to toggle source
# File lib/newgistics/response_handlers/update_shipment_address.rb, line 10
def handle(response)
  PostErrors.new(shipment_address_update).handle(response)
  if shipment_address_update.errors.empty?
    handle_successful_response(response)
  end
end

Private Instance Methods

handle_successful_response(response) click to toggle source
# File lib/newgistics/response_handlers/update_shipment_address.rb, line 19
def handle_successful_response(response)
  xml = Nokogiri::XML(response.body)
  shipment_address_update.success = xml.at_css('success').text
end