Module: Ollama::JSONLoader
- Included in:
- Client::Configuration::Config, Options
- Defined in:
- lib/ollama/json_loader.rb
Overview
Instance Method Summary collapse
- 
  
    
      #load_from_json(path)  ⇒ self 
    
    
  
  
  
  
  
  
  
  
  
    The load_from_json method loads configuration data from a JSON file. 
Instance Method Details
#load_from_json(path) ⇒ self
The load_from_json method loads configuration data from a JSON file.
This method reads the specified JSON file and uses its contents to initialize a new instance of the class by passing the parsed data as keyword arguments to the constructor.
| 19 20 21 22 | # File 'lib/ollama/json_loader.rb', line 19 def load_from_json(path) json = File.read(path) new(**config_hash = JSON.parse(json, symbolize_names: true)) end |