Class: AxiomusApi::StatusResponse
- Inherits:
-
Object
- Object
- AxiomusApi::StatusResponse
- Defined in:
- lib/axiomus_api/response/status_response.rb
Defined Under Namespace
Classes: Item, Order, Pack, PostStatus, Status
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#d_date ⇒ Object
Returns the value of attribute d_date.
-
#order ⇒ Object
Returns the value of attribute order.
-
#packs ⇒ Object
Returns the value of attribute packs.
-
#poststatus ⇒ Object
Returns the value of attribute poststatus.
-
#refused_items ⇒ Object
Returns the value of attribute refused_items.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(xml) ⇒ StatusResponse
constructor
A new instance of StatusResponse.
Constructor Details
#initialize(xml) ⇒ StatusResponse
Returns a new instance of StatusResponse.
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# 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 |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
66 67 68 |
# File 'lib/axiomus_api/response/status_response.rb', line 66 def code @code end |
#d_date ⇒ Object
Returns the value of attribute d_date.
60 61 62 |
# File 'lib/axiomus_api/response/status_response.rb', line 60 def d_date @d_date end |
#order ⇒ Object
Returns the value of attribute order.
64 65 66 |
# File 'lib/axiomus_api/response/status_response.rb', line 64 def order @order end |
#packs ⇒ Object
Returns the value of attribute packs.
63 64 65 |
# File 'lib/axiomus_api/response/status_response.rb', line 63 def packs @packs end |
#poststatus ⇒ Object
Returns the value of attribute poststatus.
62 63 64 |
# File 'lib/axiomus_api/response/status_response.rb', line 62 def poststatus @poststatus end |
#refused_items ⇒ Object
Returns the value of attribute refused_items.
61 62 63 |
# File 'lib/axiomus_api/response/status_response.rb', line 61 def refused_items @refused_items end |
#status ⇒ Object
Returns the value of attribute status.
65 66 67 |
# File 'lib/axiomus_api/response/status_response.rb', line 65 def status @status end |