lib/peddler/reports.rb in peddler-0.2.1 vs lib/peddler/reports.rb in peddler-0.2.2
- old
+ new
@@ -60,12 +60,12 @@
process_response(res)
end
def process_response(res)
hash = Hash.from_xml(res)
- hash['Response']['Report'].each_pair do |key, value|
+ report = Hash.from_xml(res)['Response']['Report'] || Hash.from_xml(res)['Response']['ReportsList']['Report']
+ report.each_pair do |key, value|
if key == "ListOfDownloads"
- params = Peddler::Handlers::XMLHandler.parse(:download, value)
@download = Peddler::Feeds::Download.new(@transport, value['Download'])
@batch = Peddler::Handlers::TabDelimitedHandler.decode_response(@download.to_s)
else
self.send "#{MAPPED_PARAMS[key]}=", value
end
\ No newline at end of file