Class: Pandadoc::Api::Client
- Inherits:
-
Object
- Object
- Pandadoc::Api::Client
- Defined in:
- lib/pandadoc/api/client.rb
Instance Method Summary collapse
- #delete(path, token) ⇒ Object
- #get(path, token, params = {}) ⇒ Object
- #post_json(path, token, params = {}) ⇒ Object
Instance Method Details
#delete(path, token) ⇒ Object
17 18 19 20 |
# File 'lib/pandadoc/api/client.rb', line 17 def delete(path, token) uri = build_uri(path) HTTParty.delete(uri, headers: default_headers(token)) end |
#get(path, token, params = {}) ⇒ Object
6 7 8 9 |
# File 'lib/pandadoc/api/client.rb', line 6 def get(path, token, params = {}) uri = build_uri(path) HTTParty.get(uri, headers: default_headers(token), query: params) end |
#post_json(path, token, params = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/pandadoc/api/client.rb', line 11 def post_json(path, token, params = {}) uri = build_uri(path) headers = default_headers(token).merge('Content-Type' => 'application/json') HTTParty.post(uri, headers: headers, body: params.to_json) end |