Class: RigidWorkflow::StepResult
- Inherits:
-
Object
- Object
- RigidWorkflow::StepResult
- Defined in:
- lib/rigid_workflow/step_result.rb
Overview
Represents the result of a workflow step execution.
Instance Method Summary collapse
-
#failure? ⇒ Boolean
Returns true if the step failed all retry attempts.
-
#initialize(status, output = {}) ⇒ StepResult
constructor
private
A new instance of StepResult.
-
#success? ⇒ Boolean
Returns true if the step completed successfully.
-
#to_h ⇒ Hash
Returns the output as a hash.
Constructor Details
#initialize(status, output = {}) ⇒ StepResult
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of StepResult.
7 8 9 10 |
# File 'lib/rigid_workflow/step_result.rb', line 7 def initialize(status, output = {}) @status = status.to_s @output = (output || {}).with_indifferent_access end |
Instance Method Details
#failure? ⇒ Boolean
Returns true if the step failed all retry attempts.
20 21 22 |
# File 'lib/rigid_workflow/step_result.rb', line 20 def failure? @status == "failed" end |
#success? ⇒ Boolean
Returns true if the step completed successfully.
14 15 16 |
# File 'lib/rigid_workflow/step_result.rb', line 14 def success? @status == "completed" end |
#to_h ⇒ Hash
Returns the output as a hash.
28 29 30 |
# File 'lib/rigid_workflow/step_result.rb', line 28 def to_h @output.to_h end |