Class: Retab::StoredBlockExecution
- Inherits:
-
Types::BaseModel
- Object
- Types::BaseModel
- Retab::StoredBlockExecution
- Defined in:
- lib/retab/workflow_block_executions/stored_block_execution.rb
Constant Summary collapse
- HASH_ATTRS =
{ id: :id, workflow_id: :workflow_id, run_id: :run_id, block_id: :block_id, block_type: :block_type, lifecycle: :lifecycle, handle_inputs: :handle_inputs, artifact: :artifact, handle_outputs: :handle_outputs, routing_decision: :routing_decision, duration_ms: :duration_ms, created_at: :created_at, block_config: :block_config, step_id: :step_id, available_iterations: :available_iterations }.freeze
Instance Attribute Summary collapse
-
#artifact ⇒ Object
Returns the value of attribute artifact.
-
#available_iterations ⇒ Object
Returns the value of attribute available_iterations.
-
#block_config ⇒ Object
Returns the value of attribute block_config.
-
#block_id ⇒ Object
Returns the value of attribute block_id.
-
#block_type ⇒ Object
Returns the value of attribute block_type.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#duration_ms ⇒ Object
Returns the value of attribute duration_ms.
-
#handle_inputs ⇒ Object
Returns the value of attribute handle_inputs.
-
#handle_outputs ⇒ Object
Returns the value of attribute handle_outputs.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
-
#routing_decision ⇒ Object
Returns the value of attribute routing_decision.
-
#run_id ⇒ Object
Returns the value of attribute run_id.
-
#step_id ⇒ Object
Returns the value of attribute step_id.
-
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
Attributes inherited from Types::BaseModel
Instance Method Summary collapse
-
#initialize(json) ⇒ StoredBlockExecution
constructor
A new instance of StoredBlockExecution.
Methods inherited from Types::BaseModel
#inspect, normalize, #to_h, #to_json
Constructor Details
#initialize(json) ⇒ StoredBlockExecution
Returns a new instance of StoredBlockExecution.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 43 def initialize(json) hash = self.class.normalize(json) @id = hash[:id] @workflow_id = hash[:workflow_id] @run_id = hash[:run_id] @block_id = hash[:block_id] @block_type = hash[:block_type] @lifecycle = hash[:lifecycle] ? (case hash[:lifecycle][:status] when "completed" then Retab::CompletedBlockExecutionLifecycle.new(hash[:lifecycle]) when "error" then Retab::ErrorBlockExecutionLifecycle.new(hash[:lifecycle]) when "skipped" then Retab::SkippedBlockExecutionLifecycle.new(hash[:lifecycle]) else hash[:lifecycle] end) : nil @handle_inputs = hash[:handle_inputs] || {} @artifact = hash[:artifact] ? Retab::StepArtifactRef.new(hash[:artifact]) : nil @handle_outputs = hash[:handle_outputs] || {} @routing_decision = (hash[:routing_decision] || []) @duration_ms = hash[:duration_ms] @created_at = hash[:created_at] @block_config = hash[:block_config] || {} @step_id = hash[:step_id] @available_iterations = (hash[:available_iterations] || []).map { |item| item || {} } end |
Instance Attribute Details
#artifact ⇒ Object
Returns the value of attribute artifact.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def artifact @artifact end |
#available_iterations ⇒ Object
Returns the value of attribute available_iterations.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def available_iterations @available_iterations end |
#block_config ⇒ Object
Returns the value of attribute block_config.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def block_config @block_config end |
#block_id ⇒ Object
Returns the value of attribute block_id.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def block_id @block_id end |
#block_type ⇒ Object
Returns the value of attribute block_type.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def block_type @block_type end |
#created_at ⇒ Object
Returns the value of attribute created_at.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def created_at @created_at end |
#duration_ms ⇒ Object
Returns the value of attribute duration_ms.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def duration_ms @duration_ms end |
#handle_inputs ⇒ Object
Returns the value of attribute handle_inputs.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def handle_inputs @handle_inputs end |
#handle_outputs ⇒ Object
Returns the value of attribute handle_outputs.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def handle_outputs @handle_outputs end |
#id ⇒ Object
Returns the value of attribute id.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def id @id end |
#lifecycle ⇒ Object
Returns the value of attribute lifecycle.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def lifecycle @lifecycle end |
#routing_decision ⇒ Object
Returns the value of attribute routing_decision.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def routing_decision @routing_decision end |
#run_id ⇒ Object
Returns the value of attribute run_id.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def run_id @run_id end |
#step_id ⇒ Object
Returns the value of attribute step_id.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def step_id @step_id end |
#workflow_id ⇒ Object
Returns the value of attribute workflow_id.
26 27 28 |
# File 'lib/retab/workflow_block_executions/stored_block_execution.rb', line 26 def workflow_id @workflow_id end |