Class: Ollama::Handlers::DumpYAML
- Inherits:
-
Object
- Object
- Ollama::Handlers::DumpYAML
- Includes:
- Concern
- Defined in:
- lib/ollama/handlers/dump_yaml.rb
Overview
A handler that outputs YAML representations of responses to the specified output stream.
This class is designed to serialize and display API responses in YAML format, making it easy to inspect the raw data returned by Ollama commands. It implements the standard handler interface and can be used with any command that supports response processing.
Instance Attribute Summary
Attributes included from Concern
Instance Method Summary collapse
-
#call(response) ⇒ self
The call method processes a response by outputting its YAML representation.
Methods included from Concern
Instance Method Details
#call(response) ⇒ self
The call method processes a response by outputting its YAML representation.
This method takes a response object and serializes it into YAML format, writing the result to the configured output stream. It is designed to handle API responses that need to be displayed or logged in a structured YAML format for debugging or inspection purposes.
and output
response
26 27 28 29 |
# File 'lib/ollama/handlers/dump_yaml.rb', line 26 def call(response) @output.puts Psych.dump(response) self end |