Class: LittleGhost::Tool::ExecutionResult
- Inherits:
-
Data
- Object
- Data
- LittleGhost::Tool::ExecutionResult
- Defined in:
- lib/little_ghost/tool.rb,
lib/little_ghost/tool.rb
Overview
Reports the caller-safe outcome of one tool execution. It keeps model-facing content and status beside the original exception retained for application-side inspection.
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(content:, status:, error: nil) ⇒ ExecutionResult
constructor
A new instance of ExecutionResult.
- #success? ⇒ Boolean
Constructor Details
#initialize(content:, status:, error: nil) ⇒ ExecutionResult
Returns a new instance of ExecutionResult.
80 81 82 |
# File 'lib/little_ghost/tool.rb', line 80 def initialize(content:, status:, error: nil) super end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content
79 80 81 |
# File 'lib/little_ghost/tool.rb', line 79 def content @content end |
#error ⇒ Object (readonly)
Returns the value of attribute error
79 80 81 |
# File 'lib/little_ghost/tool.rb', line 79 def error @error end |
#status ⇒ Object (readonly)
Returns the value of attribute status
79 80 81 |
# File 'lib/little_ghost/tool.rb', line 79 def status @status end |
Instance Method Details
#error? ⇒ Boolean
88 89 90 |
# File 'lib/little_ghost/tool.rb', line 88 def error? status == :error end |
#success? ⇒ Boolean
84 85 86 |
# File 'lib/little_ghost/tool.rb', line 84 def success? status == :success end |