Class: RubyCode::ToolResult

Inherits:
Object
  • Object
show all
Defined in:
lib/rubycode/value_objects.rb

Overview

Represents the result of a tool execution

Instance Attribute Summary collapse

Instance Method Summary collapse

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

Returns:

  • (Boolean)


62
63
64
# File 'lib/rubycode/value_objects.rb', line 62

def truncated?
  [:truncated] == true
end