Class: Ollama::Commands::Ps

Inherits:
Object
  • Object
show all
Defined in:
lib/ollama/commands/ps.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**parameters) ⇒ Ps

Returns a new instance of Ps.



6
7
8
9
10
# File 'lib/ollama/commands/ps.rb', line 6

def initialize(**parameters)
  parameters.empty? or raise ArgumentError,
    "Invalid parameters: #{parameters.keys * ' '}"
  @stream = false
end

Instance Attribute Details

#client=(value) ⇒ Object (writeonly)

Sets the attribute client

Parameters:

  • value

    the value to set the attribute client to.



14
15
16
# File 'lib/ollama/commands/ps.rb', line 14

def client=(value)
  @client = value
end

#streamObject (readonly)

Returns the value of attribute stream.



12
13
14
# File 'lib/ollama/commands/ps.rb', line 12

def stream
  @stream
end

Class Method Details

.pathObject



2
3
4
# File 'lib/ollama/commands/ps.rb', line 2

def self.path
  '/api/ps'
end

Instance Method Details

#perform(handler) ⇒ Object



16
17
18
# File 'lib/ollama/commands/ps.rb', line 16

def perform(handler)
  @client.request(method: :get, path: self.class.path, stream:, handler:)
end