lib/inforouter/responses/documents.rb in inforouter-0.2.8 vs lib/inforouter/responses/documents.rb in inforouter-0.2.9
- old
+ new
@@ -15,9 +15,10 @@
# @return [Array<Inforouter::Document>]
def parse(savon_response)
response = new(savon_response)
data = response.match('get_documents1_response/get_documents1_result/response')
return [] if data[:@itemcount].to_i == 0
+ data[:d] = [data[:d]] if data[:d].is_a?(Hash)
data[:d].map do |document|
Inforouter::Document.new(
id: document[:@id].to_i,
name: document[:@n].strip,
modification_date: parse_datetime(document[:@mdate]),