Class: Ollama::Handlers::Collector

Inherits:
Object
  • Object
show all
Includes:
Concern
Defined in:
lib/ollama/handlers/collector.rb

Instance Attribute Summary

Attributes included from Concern

#output

Instance Method Summary collapse

Methods included from Concern

#to_proc

Constructor Details

#initialize(output: $stdout) ⇒ Collector

Returns a new instance of Collector.



4
5
6
7
# File 'lib/ollama/handlers/collector.rb', line 4

def initialize(output: $stdout)
  super
  @array = []
end

Instance Method Details

#call(response) ⇒ Object



9
10
11
12
# File 'lib/ollama/handlers/collector.rb', line 9

def call(response)
  @array << response
  self
end

#resultObject



14
15
16
# File 'lib/ollama/handlers/collector.rb', line 14

def result
  @array
end