Class: Ductr::Store::JobSerializer::SerializedJob
- Inherits:
-
Struct
- Object
- Struct
- Ductr::Store::JobSerializer::SerializedJob
- Defined in:
- lib/ductr/store/job_serializer.rb,
lib/ductr/store/job_serializer.rb
Instance Attribute Summary collapse
-
#error ⇒ Exception?
readonly
The job’s error if any.
-
#job_id ⇒ String
readonly
The active job’s job id.
-
#status ⇒ Symbol
readonly
The job’s status.
Instance Method Summary collapse
-
#initialize(job_id, status, error) ⇒ SerializedJob
constructor
A new instance of SerializedJob.
-
#stopped? ⇒ Boolean
Determines whether the job has a ‘completed` or `failed` status.
Constructor Details
#initialize(job_id, status, error) ⇒ SerializedJob
Returns a new instance of SerializedJob.
19 20 21 22 23 |
# File 'lib/ductr/store/job_serializer.rb', line 19 def initialize(job_id, status, error) @job_id = job_id @status = status @error = error end |
Instance Attribute Details
#error ⇒ Exception? (readonly)
Returns The job’s error if any.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ductr/store/job_serializer.rb', line 13 class SerializedJob < Struct # # @param [String] job_id Active job's job id # @param [Symbol] status Job's status # @param [Exception, nil] error Job's error # def initialize(job_id, status, error) @job_id = job_id @status = status @error = error end end |
#job_id ⇒ String (readonly)
Returns The active job’s job id.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ductr/store/job_serializer.rb', line 13 class SerializedJob < Struct # # @param [String] job_id Active job's job id # @param [Symbol] status Job's status # @param [Exception, nil] error Job's error # def initialize(job_id, status, error) @job_id = job_id @status = status @error = error end end |
#status ⇒ Symbol (readonly)
Returns The job’s status.
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ductr/store/job_serializer.rb', line 13 class SerializedJob < Struct # # @param [String] job_id Active job's job id # @param [Symbol] status Job's status # @param [Exception, nil] error Job's error # def initialize(job_id, status, error) @job_id = job_id @status = status @error = error end end |
Instance Method Details
#stopped? ⇒ Boolean
Determines whether the job has a ‘completed` or `failed` status.
42 43 44 |
# File 'lib/ductr/store/job_serializer.rb', line 42 def stopped? %i[completed failed].include? status end |