Class: ActiveJob::Temporal::BatchEnqueueItemResult
- Inherits:
-
Object
- Object
- ActiveJob::Temporal::BatchEnqueueItemResult
- Defined in:
- lib/activejob/temporal/batch_enqueue_result.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#job ⇒ Object
readonly
Returns the value of attribute job.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #duplicate? ⇒ Boolean
- #failure? ⇒ Boolean
-
#initialize(index:, job:, status:, handle: nil, error: nil) ⇒ BatchEnqueueItemResult
constructor
A new instance of BatchEnqueueItemResult.
- #success? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(index:, job:, status:, handle: nil, error: nil) ⇒ BatchEnqueueItemResult
Returns a new instance of BatchEnqueueItemResult.
25 26 27 28 29 30 31 |
# File 'lib/activejob/temporal/batch_enqueue_result.rb', line 25 def initialize(index:, job:, status:, handle: nil, error: nil) @index = index @job = job @status = status @handle = handle @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
23 24 25 |
# File 'lib/activejob/temporal/batch_enqueue_result.rb', line 23 def error @error end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
23 24 25 |
# File 'lib/activejob/temporal/batch_enqueue_result.rb', line 23 def handle @handle end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
23 24 25 |
# File 'lib/activejob/temporal/batch_enqueue_result.rb', line 23 def index @index end |
#job ⇒ Object (readonly)
Returns the value of attribute job.
23 24 25 |
# File 'lib/activejob/temporal/batch_enqueue_result.rb', line 23 def job @job end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
23 24 25 |
# File 'lib/activejob/temporal/batch_enqueue_result.rb', line 23 def status @status end |
Instance Method Details
#duplicate? ⇒ Boolean
37 38 39 |
# File 'lib/activejob/temporal/batch_enqueue_result.rb', line 37 def duplicate? status == :duplicate end |
#failure? ⇒ Boolean
41 42 43 |
# File 'lib/activejob/temporal/batch_enqueue_result.rb', line 41 def failure? status == :failed end |
#success? ⇒ Boolean
33 34 35 |
# File 'lib/activejob/temporal/batch_enqueue_result.rb', line 33 def success? status == :success end |
#to_h ⇒ Object
45 46 47 48 49 50 51 52 53 54 |
# File 'lib/activejob/temporal/batch_enqueue_result.rb', line 45 def to_h { index: index, job_class: job.class.name, job_id: job.job_id, status: status, handle: handle, error: formatted_error }.compact end |