Class: Ollama::Commands::Ps
- Inherits:
-
Object
- Object
- Ollama::Commands::Ps
- Defined in:
- lib/ollama/commands/ps.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
writeonly
Sets the attribute client.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**parameters) ⇒ Ps
constructor
A new instance of Ps.
- #perform(handler) ⇒ Object
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
14 15 16 |
# File 'lib/ollama/commands/ps.rb', line 14 def client=(value) @client = value end |
#stream ⇒ Object (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
.path ⇒ Object
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 |