Class: Ollama::Response
- Inherits:
-
JSON::GenericObject
- Object
- JSON::GenericObject
- Ollama::Response
- Defined in:
- lib/ollama/response.rb
Overview
A subclass of JSON::GenericObject that represents responses from the Ollama API.
This class serves as a specialized response object that extends JSON::GenericObject to provide structured access to API response data. It maintains the ability to convert to JSON format while preserving the response data in a hash-like structure.
Instance Method Summary collapse
-
#as_json ⇒ Hash
The as_json method converts the object's attributes into a JSON-compatible hash.
Instance Method Details
#as_json ⇒ Hash
Note:
This removes "json_class" attribute from hash for responses.
The as_json method converts the object's attributes into a JSON-compatible hash.
This method gathers all defined attributes of the object and constructs a hash representation, excluding any nil values or empty collections.
19 20 21 |
# File 'lib/ollama/response.rb', line 19 def as_json(*) to_hash end |