Class: JasperClient::RepositoryService::Response::RunReportResponse

Inherits:
JasperClient::RepositoryService::Response show all
Defined in:
lib/jasper-client/jasper_client.rb

Overview

Response from a runReport request.

Instance Attribute Summary collapse

Attributes inherited from JasperClient::RepositoryService::Response

#resources, #xml_doc

Instance Method Summary collapse

Methods inherited from JasperClient::RepositoryService::Response

#collect_resources, #message, #return_code, #search, #success?

Constructor Details

#initialize(savon_response) ⇒ RunReportResponse



215
216
217
218
219
220
221
222
# File 'lib/jasper-client/jasper_client.rb', line 215

def initialize(savon_response)
  savon_response.tap do |soap|
    @http = soap.http
    xml = http.multipart? ? http.start_part : soap.http.body # soap.to_hash.fetch(:run_report_response).fetch(:run_report_return)
    soap_doc = Nokogiri::XML xml
    @xml_doc = Nokogiri::XML soap_doc.search('//runReportReturn/node()').inner_text
  end
end

Instance Attribute Details

#httpObject (readonly)

Returns the value of attribute http.



214
215
216
# File 'lib/jasper-client/jasper_client.rb', line 214

def http
  @http
end

Instance Method Details

#partsObject

return the multipart related parts from the http response. When the response is not multipart, an empty list is returned.



226
227
228
# File 'lib/jasper-client/jasper_client.rb', line 226

def parts
  http.multipart? ? http.parts : []
end