class Fizzy::Api::Endpoints::RenderGraph

Public Instance Methods

execute() click to toggle source
# File lib/fizzy/api/endpoints/render_graph.rb, line 12
def execute
  response = Api.basic_auth_session.get("/dossier/#{dossier_id}"\
                                        "/protocol_subscriptions/#{protocol_subscription_id}" \
                                        "/render/#{path}", options)
  process_response(response)
end

Private Instance Methods

invalid_response(response) click to toggle source
# File lib/fizzy/api/endpoints/render_graph.rb, line 21
def invalid_response(response)
  case response.code
  when 202
    raise Errors::OutcomeNotAvailableError, select_measurement_text(response,
                                                                    'The results have not yet been calculated.')
  when 204
    raise Errors::TooFewMeasurementsError, select_measurement_text(response,
                                                                   'Not enough measurements available.')
  when 404
    raise Errors::GraphNotFoundError, select_measurement_text(response,
                                                              'Graph not found.')
  else
    raise Errors::UnexpectedStatusError, "Status code #{response.code} not expected."
  end
end