Class: Aidp::Execute::DeterministicUnits::Result
- Inherits:
-
Object
- Object
- Aidp::Execute::DeterministicUnits::Result
- Defined in:
- lib/aidp/execute/deterministic_unit.rb
Overview
Result wrapper returned after executing a deterministic unit.
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#finished_at ⇒ Object
readonly
Returns the value of attribute finished_at.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#output_path ⇒ Object
readonly
Returns the value of attribute output_path.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(name:, status:, output_path:, started_at:, finished_at:, data: {}, error: nil) ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
- #timeout? ⇒ Boolean
Constructor Details
#initialize(name:, status:, output_path:, started_at:, finished_at:, data: {}, error: nil) ⇒ Result
Returns a new instance of Result.
91 92 93 94 95 96 97 98 99 100 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 91 def initialize(name:, status:, output_path:, started_at:, finished_at:, data: {}, error: nil) @name = name @status = status.to_sym @output_path = output_path @started_at = started_at @finished_at = finished_at @duration = finished_at - started_at @data = data @error = error end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
88 89 90 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 88 def data @data end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
88 89 90 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 88 def duration @duration end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
88 89 90 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 88 def error @error end |
#finished_at ⇒ Object (readonly)
Returns the value of attribute finished_at.
88 89 90 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 88 def finished_at @finished_at end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
88 89 90 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 88 def name @name end |
#output_path ⇒ Object (readonly)
Returns the value of attribute output_path.
88 89 90 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 88 def output_path @output_path end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
88 89 90 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 88 def started_at @started_at end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
88 89 90 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 88 def status @status end |
Instance Method Details
#failure? ⇒ Boolean
106 107 108 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 106 def failure? status == :failure end |
#success? ⇒ Boolean
102 103 104 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 102 def success? status == :success end |
#timeout? ⇒ Boolean
110 111 112 |
# File 'lib/aidp/execute/deterministic_unit.rb', line 110 def timeout? status == :timeout end |