Class: MWS::Feeds::Parser
- Inherits:
-
Object
- Object
- MWS::Feeds::Parser
- Includes:
- Peddler::Headers
- Defined in:
- lib/mws/feeds/parser.rb
Instance Method Summary collapse
- #body ⇒ Object
- #headers ⇒ Object
-
#initialize(response, _encoding) ⇒ Parser
constructor
A new instance of Parser.
- #parse ⇒ Object
- #status_code ⇒ Object
Constructor Details
#initialize(response, _encoding) ⇒ Parser
Returns a new instance of Parser.
15 16 17 |
# File 'lib/mws/feeds/parser.rb', line 15 def initialize(response, _encoding) @response = response end |
Instance Method Details
#body ⇒ Object
44 45 46 |
# File 'lib/mws/feeds/parser.rb', line 44 def body @response.body end |
#headers ⇒ Object
36 37 38 |
# File 'lib/mws/feeds/parser.rb', line 36 def headers @response.headers end |
#parse ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/mws/feeds/parser.rb', line 19 def parse node = find_payload case node.name when /GetFeedSubmissionCount/ FeedSubmissionCount.new(node) when /SubmitFeedResult/ FeedSubmissionInfo.new(node.at('FeedSubmissionInfo')) when /GetFeedSubmissionListResult/ FeedSubmissionList.new(node) when 'ProcessingReport' FeedSubmissionResult.new(node, namespace: nil) else raise NotImplementedError, node.name end end |
#status_code ⇒ Object
40 41 42 |
# File 'lib/mws/feeds/parser.rb', line 40 def status_code @response.status end |