Class: AxiomusApi::OrderResponse
- Inherits:
-
Object
- Object
- AxiomusApi::OrderResponse
- Defined in:
- lib/axiomus_api/response/order_response.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#description ⇒ Object
Returns the value of attribute description.
-
#object_id ⇒ Object
Returns the value of attribute object_id.
-
#okey ⇒ Object
Returns the value of attribute okey.
-
#price ⇒ Object
Returns the value of attribute price.
-
#request ⇒ Object
Returns the value of attribute request.
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(xml) ⇒ OrderResponse
constructor
A new instance of OrderResponse.
- #success? ⇒ Boolean
Constructor Details
#initialize(xml) ⇒ OrderResponse
Returns a new instance of OrderResponse.
11 12 13 14 15 16 17 18 19 |
# File 'lib/axiomus_api/response/order_response.rb', line 11 def initialize(xml) doc = Nokogiri::XML(xml) @request = doc.xpath('response/request').text @okey = doc.xpath('response/auth').text @object_id = doc.xpath('response/auth/@objectid').text @code = doc.xpath('response/status/@code').text.to_i @description = doc.xpath('response/status').text @price = doc.xpath('response/status/@price').text end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
6 7 8 |
# File 'lib/axiomus_api/response/order_response.rb', line 6 def code @code end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/axiomus_api/response/order_response.rb', line 7 def description @description end |
#object_id ⇒ Object
Returns the value of attribute object_id.
5 6 7 |
# File 'lib/axiomus_api/response/order_response.rb', line 5 def object_id @object_id end |
#okey ⇒ Object
Returns the value of attribute okey.
4 5 6 |
# File 'lib/axiomus_api/response/order_response.rb', line 4 def okey @okey end |
#price ⇒ Object
Returns the value of attribute price.
8 9 10 |
# File 'lib/axiomus_api/response/order_response.rb', line 8 def price @price end |
#request ⇒ Object
Returns the value of attribute request.
9 10 11 |
# File 'lib/axiomus_api/response/order_response.rb', line 9 def request @request end |
Instance Method Details
#error_message ⇒ Object
21 22 23 |
# File 'lib/axiomus_api/response/order_response.rb', line 21 def @description unless success? end |
#success? ⇒ Boolean
25 26 27 |
# File 'lib/axiomus_api/response/order_response.rb', line 25 def success? @code == AxiomusApi::ResponseCodes::SUCCESS end |