class Newgistics::ResponseHandlers::PostInboundReturn

Attributes

inbound_return[R]

Public Class Methods

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

Public Instance Methods

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

Private Instance Methods

handle_successful_response(response) click to toggle source
# File lib/newgistics/response_handlers/post_inbound_return.rb, line 19
def handle_successful_response(response)
  xml = Nokogiri::XML(response.body)
  inbound_return.id = xml.css('Return').first['ID']
end