Class: YahooGeminiClient::CustomReportResponse

Inherits:
BaseResponse
  • Object
show all
Defined in:
lib/yahoo_gemini_client/responses/custom_report_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseResponse

#error?

Constructor Details

#initialize(json_response) ⇒ CustomReportResponse

Returns a new instance of CustomReportResponse.



5
6
7
8
9
10
11
12
13
# File 'lib/yahoo_gemini_client/responses/custom_report_response.rb', line 5

def initialize(json_response)
  @errors = json_response[:errors]
  @timestamp = json_response[:timestamp]
  if json_response[:response]
    @job_id = json_response[:response][:jobId]
    @status = json_response[:response][:status]
    @csv_url = json_response[:response][:jobResponse]
  end
end

Instance Attribute Details

#csv_urlObject

Returns the value of attribute csv_url.



3
4
5
# File 'lib/yahoo_gemini_client/responses/custom_report_response.rb', line 3

def csv_url
  @csv_url
end

#errorsObject

Returns the value of attribute errors.



3
4
5
# File 'lib/yahoo_gemini_client/responses/custom_report_response.rb', line 3

def errors
  @errors
end

#job_idObject

Returns the value of attribute job_id.



3
4
5
# File 'lib/yahoo_gemini_client/responses/custom_report_response.rb', line 3

def job_id
  @job_id
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/yahoo_gemini_client/responses/custom_report_response.rb', line 3

def status
  @status
end

#timestampObject

Returns the value of attribute timestamp.



3
4
5
# File 'lib/yahoo_gemini_client/responses/custom_report_response.rb', line 3

def timestamp
  @timestamp
end

Instance Method Details

#completed?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/yahoo_gemini_client/responses/custom_report_response.rb', line 15

def completed?
  @status == "completed"
end