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(*ignored)  ⇒ Hash 
    
    
  
  
  
  
  
  
  
  
  
    The as_json method converts the object’s attributes into a JSON-compatible hash. 
Instance Method Details
#as_json(*ignored) ⇒ 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.
| 21 22 23 | # File 'lib/ollama/response.rb', line 21 def as_json(*ignored) to_hash end |