Class: LightSide::PredictionTask

Inherits:
Object
  • Object
show all
Includes:
Resources
Defined in:
lib/lightside/models/prediction_task.rb

Instance Method Summary collapse

Methods included from Resources

#attributes, #delete, #id, included, #initialize, #reload, #save, #set_attributes_from_hash, #to_s, #update, #writable_attributes

Instance Method Details

#process_startObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/lightside/models/prediction_task.rb', line 11

def process_start
  RestClient.post(process, "", Config.headers) do |response, request, result|
    case response.code
    when 200, 202
      return JSON.parse(response)
    when 404
      raise ResourceNotFound, "could not find #{name} with ID=#{id}"
    else
      raise JSON.parse(response)["detail"]
    end
  end
end