Class: Replicate::Record::Prediction
- Inherits:
-
Base
- Object
- Base
- Replicate::Record::Prediction
show all
- Defined in:
- lib/replicate/record/prediction.rb
Instance Attribute Summary
Attributes inherited from Base
#client, #data
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #inspect, #method_missing
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Replicate::Record::Base
Instance Method Details
#cancel ⇒ Object
10
11
12
|
# File 'lib/replicate/record/prediction.rb', line 10
def cancel
@data = client.cancel_prediction(id).data
end
|
#canceled? ⇒ Boolean
39
40
41
|
# File 'lib/replicate/record/prediction.rb', line 39
def canceled?
status == "canceled"
end
|
#failed? ⇒ Boolean
35
36
37
|
# File 'lib/replicate/record/prediction.rb', line 35
def failed?
status == "failed"
end
|
#finished? ⇒ Boolean
14
15
16
17
18
19
20
21
|
# File 'lib/replicate/record/prediction.rb', line 14
def finished?
case status
when "succeeded", "failed", "canceled"
true
else
false
end
end
|
#processing? ⇒ Boolean
27
28
29
|
# File 'lib/replicate/record/prediction.rb', line 27
def processing?
status == "processing"
end
|
#refetch ⇒ Object
6
7
8
|
# File 'lib/replicate/record/prediction.rb', line 6
def refetch
@data = client.retrieve_prediction(id).data
end
|
#starting? ⇒ Boolean
23
24
25
|
# File 'lib/replicate/record/prediction.rb', line 23
def starting?
status == "starting"
end
|
#succeeded? ⇒ Boolean
31
32
33
|
# File 'lib/replicate/record/prediction.rb', line 31
def succeeded?
status == "succeeded"
end
|