Class: Ollama::Commands::Show

Inherits:
Object
  • Object
show all
Includes:
DTO
Defined in:
lib/ollama/commands/show.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:, verbose: nil) ⇒ Show

Returns a new instance of Show.



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

def initialize(name:, verbose: nil)
  @name, @verbose = name, verbose
  @stream = false
end

Instance Attribute Details

#client=(value) ⇒ Object (writeonly)

Sets the attribute client

Parameters:

  • value

    the value to set the attribute client to.



15
16
17
# File 'lib/ollama/commands/show.rb', line 15

def client=(value)
  @client = value
end

#nameObject (readonly)

Returns the value of attribute name.



13
14
15
# File 'lib/ollama/commands/show.rb', line 13

def name
  @name
end

#streamObject (readonly)

Returns the value of attribute stream.



13
14
15
# File 'lib/ollama/commands/show.rb', line 13

def stream
  @stream
end

#verboseObject (readonly)

Returns the value of attribute verbose.



13
14
15
# File 'lib/ollama/commands/show.rb', line 13

def verbose
  @verbose
end

Class Method Details

.pathObject



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

def self.path
  '/api/show'
end

Instance Method Details

#perform(handler) ⇒ Object



17
18
19
# File 'lib/ollama/commands/show.rb', line 17

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