Class: RubyCode::ToolResult
- Inherits:
-
Object
- Object
- RubyCode::ToolResult
- Defined in:
- lib/rubycode/value_objects.rb
Overview
Represents the result of a tool execution
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(content:, metadata: {}) ⇒ ToolResult
constructor
A new instance of ToolResult.
- #line_count ⇒ Object
- #to_s ⇒ Object
- #truncated? ⇒ Boolean
Constructor Details
#initialize(content:, metadata: {}) ⇒ ToolResult
Returns a new instance of ToolResult.
53 54 55 56 |
# File 'lib/rubycode/value_objects.rb', line 53 def initialize(content:, metadata: {}) @content = content @metadata = end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
51 52 53 |
# File 'lib/rubycode/value_objects.rb', line 51 def content @content end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
51 52 53 |
# File 'lib/rubycode/value_objects.rb', line 51 def @metadata end |
Instance Method Details
#==(other) ⇒ Object
70 71 72 73 74 |
# File 'lib/rubycode/value_objects.rb', line 70 def ==(other) other.is_a?(ToolResult) && content == other.content && == other. end |
#line_count ⇒ Object
66 67 68 |
# File 'lib/rubycode/value_objects.rb', line 66 def line_count [:line_count] end |
#to_s ⇒ Object
58 59 60 |
# File 'lib/rubycode/value_objects.rb', line 58 def to_s content end |
#truncated? ⇒ Boolean
62 63 64 |
# File 'lib/rubycode/value_objects.rb', line 62 def truncated? [:truncated] == true end |