class Riffer::Agent::StructuredOutput::Result
Wraps the result of structured output parsing and validation.
Attributes
The error message, or nil on success.
The validated object, or nil on failure.
Public Class Methods
Source
# File lib/riffer/agent/structured_output/result.rb, line 14 def initialize(object: nil, error: nil) @object = object @error = error end
Public Instance Methods
Source
# File lib/riffer/agent/structured_output/result.rb, line 29 def failure? = !success? end
Returns true when parsing or validation failed.
Source
# File lib/riffer/agent/structured_output/result.rb, line 23 def success? = @error.nil? # Returns true when parsing or validation failed. # #-- #: () -> bool def failure? = !success?
Returns true when parsing and validation succeeded.