Class: Ollama::Commands::Push
- Inherits:
-
Object
- Object
- Ollama::Commands::Push
- Includes:
- DTO
- Defined in:
- lib/ollama/commands/push.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
writeonly
Sets the attribute client.
-
#insecure ⇒ Object
readonly
Returns the value of attribute insecure.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name:, insecure: nil, stream: true) ⇒ Push
constructor
A new instance of Push.
- #perform(handler) ⇒ Object
Methods included from DTO
#as_array_of_hashes, #as_json, #empty?, #to_json
Constructor Details
#initialize(name:, insecure: nil, stream: true) ⇒ Push
Returns a new instance of Push.
8 9 10 |
# File 'lib/ollama/commands/push.rb', line 8 def initialize(name:, insecure: nil, stream: true) @name, @insecure, @stream = name, insecure, stream end |
Instance Attribute Details
#client=(value) ⇒ Object (writeonly)
Sets the attribute client
14 15 16 |
# File 'lib/ollama/commands/push.rb', line 14 def client=(value) @client = value end |
#insecure ⇒ Object (readonly)
Returns the value of attribute insecure.
12 13 14 |
# File 'lib/ollama/commands/push.rb', line 12 def insecure @insecure end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/ollama/commands/push.rb', line 12 def name @name end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
12 13 14 |
# File 'lib/ollama/commands/push.rb', line 12 def stream @stream end |
Class Method Details
.path ⇒ Object
4 5 6 |
# File 'lib/ollama/commands/push.rb', line 4 def self.path '/api/push' end |
Instance Method Details
#perform(handler) ⇒ Object
16 17 18 |
# File 'lib/ollama/commands/push.rb', line 16 def perform(handler) @client.request(method: :post, path: self.class.path, body: to_json, stream:, handler:) end |