Class: LLM::JSONAdapter
- Inherits:
-
Object
- Object
- LLM::JSONAdapter
- Defined in:
- lib/llm/json_adapter.rb
Overview
The JSONAdapter class defines the interface for JSON parsers that can be used by the library when dealing with JSON. The following parsers are supported:
Defined Under Namespace
Class Method Summary collapse
-
.dump ⇒ String
Returns a JSON string representation of the given object.
-
.load ⇒ Object
Returns a Ruby object parsed from the given JSON string.
-
.parser_error ⇒ Exception
Returns the error raised when parsing fails.
Class Method Details
.dump ⇒ String
Returns a JSON string representation of the given object
18 |
# File 'lib/llm/json_adapter.rb', line 18 def self.dump(*) = raise NotImplementedError |
.load ⇒ Object
Returns a Ruby object parsed from the given JSON string
23 |
# File 'lib/llm/json_adapter.rb', line 23 def self.load(*) = raise NotImplementedError |
.parser_error ⇒ Exception
Returns the error raised when parsing fails
28 |
# File 'lib/llm/json_adapter.rb', line 28 def self.parser_error = [StandardError] |