Class: Ductr::Store::PipelineSerializer::SerializedPipeline

Inherits:
Struct
  • Object
show all
Defined in:
lib/ductr/store/pipeline_serializer.rb,
lib/ductr/store/pipeline_serializer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(job_id, status, error, steps) ⇒ SerializedPipeline

Returns a new instance of SerializedPipeline.

Parameters:

  • job_id (String)

    Pipeline job id

  • status (Symbol)

    Pipeline status

  • error (Exception, nil)

    Pipeline error

  • steps (Array<SerializedPipelineStep>)

    Pipeline steps as struct



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

#errorException? (readonly)

Returns The pipeline job error if any.

Returns:

  • (Exception, nil)

    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_idString (readonly)

Returns The active job’s job id.

Returns:

  • (String)

    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

#statusSymbol (readonly)

Returns The pipeline job status.

Returns:

  • (Symbol)

    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

#stepsArray<SerializedPipelineStep> (readonly)

Returns The pipeline steps as struct.

Returns:



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.

Returns:

  • (Boolean)

    True when the status is ‘completed` or `failed`



49
50
51
# File 'lib/ductr/store/pipeline_serializer.rb', line 49

def stopped?
  %i[completed failed].include? status
end