Class: Ductr::Store::PipelineSerializer::SerializedPipeline
- Inherits:
-
Struct
- Object
- Struct
- Ductr::Store::PipelineSerializer::SerializedPipeline
- Defined in:
- lib/ductr/store/pipeline_serializer.rb,
lib/ductr/store/pipeline_serializer.rb
Instance Attribute Summary collapse
-
#error ⇒ Exception?
readonly
The pipeline job error if any.
-
#job_id ⇒ String
readonly
The active job’s job id.
-
#status ⇒ Symbol
readonly
The pipeline job status.
-
#steps ⇒ Array<SerializedPipelineStep>
readonly
The pipeline steps as struct.
Instance Method Summary collapse
-
#initialize(job_id, status, error, steps) ⇒ SerializedPipeline
constructor
A new instance of SerializedPipeline.
-
#stopped? ⇒ Boolean
Determines whether the pipeline has a ‘completed` or `failed` status.
Constructor Details
#initialize(job_id, status, error, steps) ⇒ SerializedPipeline
Returns a new instance of SerializedPipeline.
23 24 25 26 27 28 |
# File 'lib/ductr/store/pipeline_serializer.rb', line 23 def initialize(job_id, status, error, steps) @job_id = job_id @status = status @error = error @steps = steps end |
Instance Attribute Details
#error ⇒ Exception? (readonly)
Returns The pipeline job error if any.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ductr/store/pipeline_serializer.rb', line 16 class SerializedPipeline < Struct # # @param [String] job_id Pipeline job id # @param [Symbol] status Pipeline status # @param [Exception, nil] error Pipeline error # @param [Array<SerializedPipelineStep>] steps Pipeline steps as struct # def initialize(job_id, status, error, steps) @job_id = job_id @status = status @error = error @steps = steps end end |
#job_id ⇒ String (readonly)
Returns The active job’s job id.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ductr/store/pipeline_serializer.rb', line 16 class SerializedPipeline < Struct # # @param [String] job_id Pipeline job id # @param [Symbol] status Pipeline status # @param [Exception, nil] error Pipeline error # @param [Array<SerializedPipelineStep>] steps Pipeline steps as struct # def initialize(job_id, status, error, steps) @job_id = job_id @status = status @error = error @steps = steps end end |
#status ⇒ Symbol (readonly)
Returns The pipeline job status.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ductr/store/pipeline_serializer.rb', line 16 class SerializedPipeline < Struct # # @param [String] job_id Pipeline job id # @param [Symbol] status Pipeline status # @param [Exception, nil] error Pipeline error # @param [Array<SerializedPipelineStep>] steps Pipeline steps as struct # def initialize(job_id, status, error, steps) @job_id = job_id @status = status @error = error @steps = steps end end |
#steps ⇒ Array<SerializedPipelineStep> (readonly)
Returns The pipeline steps as struct.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/ductr/store/pipeline_serializer.rb', line 16 class SerializedPipeline < Struct # # @param [String] job_id Pipeline job id # @param [Symbol] status Pipeline status # @param [Exception, nil] error Pipeline error # @param [Array<SerializedPipelineStep>] steps Pipeline steps as struct # def initialize(job_id, status, error, steps) @job_id = job_id @status = status @error = error @steps = steps end end |
Instance Method Details
#stopped? ⇒ Boolean
Determines whether the pipeline has a ‘completed` or `failed` status.
49 50 51 |
# File 'lib/ductr/store/pipeline_serializer.rb', line 49 def stopped? %i[completed failed].include? status end |