Class: NotifieeAPI::Client
- Inherits:
-
Object
- Object
- NotifieeAPI::Client
- Defined in:
- lib/notifiee_api/client.rb
Class Attribute Summary collapse
-
.api_key ⇒ Object
Returns the value of attribute api_key.
-
.base_url ⇒ Object
Returns the value of attribute base_url.
-
.debug_mode ⇒ Object
Returns the value of attribute debug_mode.
-
.version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
- .delete(endpoint) ⇒ Object
- .get(endpoint, **payload) ⇒ Object
- .patch(endpoint, **payload) ⇒ Object
- .post(endpoint, **payload) ⇒ Object
- .put(endpoint, **payload) ⇒ Object
Class Attribute Details
.api_key ⇒ Object
Returns the value of attribute api_key.
14 15 16 |
# File 'lib/notifiee_api/client.rb', line 14 def api_key @api_key end |
.base_url ⇒ Object
Returns the value of attribute base_url.
14 15 16 |
# File 'lib/notifiee_api/client.rb', line 14 def base_url @base_url end |
.debug_mode ⇒ Object
Returns the value of attribute debug_mode.
14 15 16 |
# File 'lib/notifiee_api/client.rb', line 14 def debug_mode @debug_mode end |
.version ⇒ Object
Returns the value of attribute version.
14 15 16 |
# File 'lib/notifiee_api/client.rb', line 14 def version @version end |
Class Method Details
.delete(endpoint) ⇒ Object
36 37 38 |
# File 'lib/notifiee_api/client.rb', line 36 def delete(endpoint) request "DELETE", endpoint end |
.get(endpoint, **payload) ⇒ Object
16 17 18 19 |
# File 'lib/notifiee_api/client.rb', line 16 def get(endpoint, **payload) endpoint += "?" + URI.encode_www_form(payload) unless payload.empty? request "GET", endpoint end |
.patch(endpoint, **payload) ⇒ Object
31 32 33 34 |
# File 'lib/notifiee_api/client.rb', line 31 def patch(endpoint, **payload) body = JSON.generate(payload) request "PATCH", endpoint, body end |
.post(endpoint, **payload) ⇒ Object
21 22 23 24 |
# File 'lib/notifiee_api/client.rb', line 21 def post(endpoint, **payload) body = JSON.generate(payload) request "POST", endpoint, body end |
.put(endpoint, **payload) ⇒ Object
26 27 28 29 |
# File 'lib/notifiee_api/client.rb', line 26 def put(endpoint, **payload) body = JSON.generate(payload) request "PUT", endpoint, body end |