Class: LittleGhost::Tool::ExecutionResult

Inherits:
Data
  • Object
show all
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

Instance Method Summary collapse

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

#contentObject (readonly)

Returns the value of attribute content

Returns:

  • (Object)

    the current value of content



79
80
81
# File 'lib/little_ghost/tool.rb', line 79

def content
  @content
end

#errorObject (readonly)

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



79
80
81
# File 'lib/little_ghost/tool.rb', line 79

def error
  @error
end

#statusObject (readonly)

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



79
80
81
# File 'lib/little_ghost/tool.rb', line 79

def status
  @status
end

Instance Method Details

#error?Boolean

Returns:

  • (Boolean)


88
89
90
# File 'lib/little_ghost/tool.rb', line 88

def error?
  status == :error
end

#success?Boolean

Returns:

  • (Boolean)


84
85
86
# File 'lib/little_ghost/tool.rb', line 84

def success?
  status == :success
end