Class: GoodJob::ExecutionResult
- Inherits:
-
Object
- Object
- GoodJob::ExecutionResult
- Defined in:
- app/models/good_job/execution_result.rb
Overview
Stores the results of job execution
Instance Attribute Summary collapse
- #error_event ⇒ String? readonly
- #handled_error ⇒ Exception? readonly
- #retried_job ⇒ GoodJob::Job? readonly
- #unexecutable ⇒ Boolean? readonly
- #unhandled_error ⇒ Exception? readonly
- #value ⇒ Object? readonly
Instance Method Summary collapse
-
#initialize(value:, handled_error: nil, unhandled_error: nil, error_event: nil, unexecutable: nil, retried_job: nil) ⇒ ExecutionResult
constructor
A new instance of ExecutionResult.
- #retried? ⇒ Boolean
- #succeeded? ⇒ Boolean
Constructor Details
#initialize(value:, handled_error: nil, unhandled_error: nil, error_event: nil, unexecutable: nil, retried_job: nil) ⇒ ExecutionResult
Returns a new instance of ExecutionResult.
25 26 27 28 29 30 31 32 |
# File 'app/models/good_job/execution_result.rb', line 25 def initialize(value:, handled_error: nil, unhandled_error: nil, error_event: nil, unexecutable: nil, retried_job: nil) @value = value @handled_error = handled_error @unhandled_error = unhandled_error @error_event = error_event @unexecutable = unexecutable @retried_job = retried_job end |
Instance Attribute Details
#error_event ⇒ String? (readonly)
13 14 15 |
# File 'app/models/good_job/execution_result.rb', line 13 def error_event @error_event end |
#handled_error ⇒ Exception? (readonly)
9 10 11 |
# File 'app/models/good_job/execution_result.rb', line 9 def handled_error @handled_error end |
#retried_job ⇒ GoodJob::Job? (readonly)
17 18 19 |
# File 'app/models/good_job/execution_result.rb', line 17 def retried_job @retried_job end |
#unexecutable ⇒ Boolean? (readonly)
15 16 17 |
# File 'app/models/good_job/execution_result.rb', line 15 def unexecutable @unexecutable end |
#unhandled_error ⇒ Exception? (readonly)
11 12 13 |
# File 'app/models/good_job/execution_result.rb', line 11 def unhandled_error @unhandled_error end |
#value ⇒ Object? (readonly)
7 8 9 |
# File 'app/models/good_job/execution_result.rb', line 7 def value @value end |
Instance Method Details
#retried? ⇒ Boolean
40 41 42 |
# File 'app/models/good_job/execution_result.rb', line 40 def retried? retried_job.present? end |
#succeeded? ⇒ Boolean
35 36 37 |
# File 'app/models/good_job/execution_result.rb', line 35 def succeeded? !(handled_error || unhandled_error || unexecutable || retried?) end |