Class: Clicksign::API::WhatsappNotifier
- Inherits:
-
Object
- Object
- Clicksign::API::WhatsappNotifier
- Extended by:
- Requests
- Defined in:
- lib/clicksign/api/whatsapp_notifier.rb
Constant Summary collapse
- REQUEST_PATH =
'/api/v1/notify_by_whatsapp'
- ATTRIBUTES =
[:request_signature_key]
Class Method Summary collapse
Methods included from Requests
Class Method Details
.body(params) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/clicksign/api/whatsapp_notifier.rb', line 18 def body(params) params = params.transform_keys(&:to_sym) ATTRIBUTES.each.with_object({}) do |attribute, hash| hash[attribute] = params[attribute] if params.has_key?(attribute) end end |
.notify(token:, params: {}) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/clicksign/api/whatsapp_notifier.rb', line 10 def notify(token:, params: {}) post( REQUEST_PATH, body(params), token ) end |