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

Returns a new instance of RunReportResponse.



199
200
201
202
203
204
205
206
# File 'lib/jasper-client/jasper_client.rb', line 199

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.



198
199
200
# File 'lib/jasper-client/jasper_client.rb', line 198

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.



210
211
212
# File 'lib/jasper-client/jasper_client.rb', line 210

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