Class: Ollama::Handlers::Single
- Inherits:
-
Object
- Object
- Ollama::Handlers::Single
- Includes:
- Concern
- Defined in:
- lib/ollama/handlers/single.rb
Instance Attribute Summary
Attributes included from Concern
Instance Method Summary collapse
- #call(response) ⇒ Object
-
#initialize(output: $stdout) ⇒ Single
constructor
A new instance of Single.
- #result ⇒ Object
Methods included from Concern
Constructor Details
#initialize(output: $stdout) ⇒ Single
Returns a new instance of Single.
4 5 6 7 |
# File 'lib/ollama/handlers/single.rb', line 4 def initialize(output: $stdout) super @array = [] end |
Instance Method Details
#call(response) ⇒ Object
9 10 11 12 |
# File 'lib/ollama/handlers/single.rb', line 9 def call(response) @array << response self end |
#result ⇒ Object
14 15 16 |
# File 'lib/ollama/handlers/single.rb', line 14 def result @array.size <= 1 ? @array.first : @array end |