Class: Ollama::Commands::Delete

Inherits:
Object
  • Object
show all
Includes:
DTO
Defined in:
lib/ollama/commands/delete.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from DTO

#as_array_of_hashes, #as_json, #to_json

Constructor Details

#initialize(name:) ⇒ Delete

Returns a new instance of Delete.



8
9
10
# File 'lib/ollama/commands/delete.rb', line 8

def initialize(name:)
  @name, @stream = name, 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/delete.rb', line 14

def client=(value)
  @client = value
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#streamObject (readonly)

Returns the value of attribute stream.



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

def stream
  @stream
end

Class Method Details

.pathObject



4
5
6
# File 'lib/ollama/commands/delete.rb', line 4

def self.path
  '/api/delete'
end

Instance Method Details

#perform(handler) ⇒ Object



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

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