class AxiomusApi::StatusResponse

Attributes

code[RW]
d_date[RW]
order[RW]
packs[RW]
poststatus[RW]
refused_items[RW]
status[RW]

Public Class Methods

new(xml) click to toggle source
# File lib/axiomus_api/response/status_response.rb, line 68
def initialize(xml)
  doc = Nokogiri::XML(xml)

  xml_date = doc.xpath('response/d_date')
  @d_date = Date.parse(xml_date.text) unless xml_date.empty?
  @order = Order.new(doc.xpath('response/order'))
  @refused_items = doc.xpath('response/refused_items/item').map do |node|
    Item.new(node)
  end
  @poststatus = PostStatus.new(doc.xpath('response/poststatus'))
  @packs = doc.xpath('response/packs/pack').map do |node|
    Pack.new(node)
  end
  @status = Status.new(doc.xpath('response/status'))
end