Class: Vapi::Client
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #delete(path) ⇒ Object
- #get(path, params = {}) ⇒ Object
-
#initialize(configuration = nil) ⇒ Client
constructor
A new instance of Client.
- #patch(path, data = {}) ⇒ Object
- #post(path, data = {}) ⇒ Object
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
#configuration ⇒ Object (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 |