Class: Vapi::Client

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/vapi/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration = nil) ⇒ Client

Returns a new instance of Client.



9
10
11
12
# File 'lib/vapi/client.rb', line 9

def initialize(configuration = nil)
  @configuration = configuration || Vapi.configuration
  validate_configuration!
end

Instance Attribute Details

#configurationObject (readonly)

Returns the value of attribute configuration.



7
8
9
# File 'lib/vapi/client.rb', line 7

def configuration
  @configuration
end

Instance Method Details

#delete(path) ⇒ Object



26
27
28
# File 'lib/vapi/client.rb', line 26

def delete(path)
  request(:delete, path)
end

#get(path, params = {}) ⇒ Object



14
15
16
# File 'lib/vapi/client.rb', line 14

def get(path, params = {})
  request(:get, path, query: params)
end

#patch(path, data = {}) ⇒ Object



22
23
24
# File 'lib/vapi/client.rb', line 22

def patch(path, data = {})
  request(:patch, path, body: data.to_json)
end

#post(path, data = {}) ⇒ Object



18
19
20
# File 'lib/vapi/client.rb', line 18

def post(path, data = {})
  request(:post, path, body: data.to_json)
end