Class: MagicWrite::Completions

Inherits:
Object
  • Object
show all
Defined in:
lib/magicwrite/completions.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Completions

Returns a new instance of Completions.



3
4
5
# File 'lib/magicwrite/completions.rb', line 3

def initialize(client:)
  @client = client
end

Instance Method Details

#create(id:, parameters: {}) ⇒ Object



15
16
17
# File 'lib/magicwrite/completions.rb', line 15

def create(id:, parameters: {})
  client.json_post(path: "/completions/#{id}", parameters: parameters)
end

#delete(id:, completion_id:) ⇒ Object



19
20
21
# File 'lib/magicwrite/completions.rb', line 19

def delete(id:, completion_id:)
  client.delete(path: "/completions/#{id}/#{completion_id}")
end

#execute(parameters: {}) ⇒ Object



7
8
9
# File 'lib/magicwrite/completions.rb', line 7

def execute(parameters: {})
  client.json_post(path: '/completions', parameters: parameters)
end

#retrieve(id:, parameters: {}) ⇒ Object



11
12
13
# File 'lib/magicwrite/completions.rb', line 11

def retrieve(id:, parameters: {})
  client.get(path: "/completions/#{id}", parameters: parameters)
end