Class: Amazon::MWS::Response
- Includes:
- ROXML
- Defined in:
- lib/amazon/mws/response.rb
Direct Known Subclasses
CancelFeedSubmissionsResponse, CancelReportRequestsResponse, FeedSubmission, GetFeedSubmissionCountResponse, GetFeedSubmissionListByNextTokenResponse, GetFeedSubmissionListResponse, GetFeedSubmissionResultResponse, GetFeedSubmissionResultResponse::Header, GetFeedSubmissionResultResponse::Message, GetFeedSubmissionResultResponse::ProcessingSummary, GetFeedSubmissionResultResponse::Result, GetReportCountResponse, GetReportListResponse, GetReportRequestCountResponse, GetReportRequestListByNextTokenResponse, GetReportRequestListResponse, GetReportScheduleCountResponse, GetReportScheduleListByNextTokenResponse, GetReportScheduleListResponse, ManageReportScheduleResponse, ReportInfo, ReportRequest, ReportSchedule, RequestReportResponse, ResponseError, SubmitFeedResponse, UpdateReportAcknowledgementsResponse
Class Method Summary collapse
-
.format(response) ⇒ Object
This is the factoryish method that is called!, not new.
- .parse_xml(response) ⇒ Object
Instance Method Summary collapse
Class Method Details
.format(response) ⇒ Object
This is the factoryish method that is called!, not new
9 10 11 12 13 14 15 |
# File 'lib/amazon/mws/response.rb', line 9 def self.format(response) if response.content_type =~ /xml/ || response.body =~ /<?xml/ parse_xml(response) else response.body end end |
.parse_xml(response) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/amazon/mws/response.rb', line 17 def self.parse_xml(response) if [Net::HTTPClientError, Net::HTTPServerError].any? {|error| response.is_a? error } return ResponseError.from_xml(response.body) else return self.from_xml(response.body) end end |
Instance Method Details
#accessors ⇒ Object
25 26 27 |
# File 'lib/amazon/mws/response.rb', line 25 def accessors roxml_references.map {|r| r.accessor} end |