Class: MWS::Orders::Parser
- Inherits:
-
Object
- Object
- MWS::Orders::Parser
- Includes:
- Peddler::Headers
- Defined in:
- lib/mws/orders/parser.rb
Overview
Overrides the default parser in Peddler
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response, _encoding) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
- #payload ⇒ Object
Constructor Details
#initialize(response, _encoding) ⇒ Parser
Returns a new instance of Parser.
19 20 21 |
# File 'lib/mws/orders/parser.rb', line 19 def initialize(response, _encoding) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
17 18 19 |
# File 'lib/mws/orders/parser.rb', line 17 def response @response end |
Instance Method Details
#parse ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/mws/orders/parser.rb', line 23 def parse case payload.name when /GetOrderResult/ then orders when /ListOrders.*Result/ then orders when /ListOrderItems.*Result/ then order_items when 'GetServiceStatusResult' then service_status else raise NotImplementedError end end |
#payload ⇒ Object
33 34 35 |
# File 'lib/mws/orders/parser.rb', line 33 def payload @payload ||= find_payload end |