Class: NotifieeAPI::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/notifiee_api/client.rb

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyObject

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_urlObject

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_modeObject

Returns the value of attribute debug_mode.



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

def debug_mode
  @debug_mode
end

.versionObject

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