Class: Sms77::Resources::Hooks
- Inherits:
-
Sms77::Resource
- Object
- Sms77::Resource
- Sms77::Resources::Hooks
- Defined in:
- lib/sms77/resources/hooks.rb
Constant Summary
Constants inherited from Sms77::Resource
Instance Attribute Summary
Attributes inherited from Sms77::Resource
#api_key, #builder, #conn, #endpoint, #http_methods, #request_methods, #sent_with
Instance Method Summary collapse
-
#read(params = {}) ⇒ Hash
Retrieve all webhooks.
-
#subscribe(params) ⇒ Hash
Register a new webhook.
-
#unsubscribe(params) ⇒ Hash
Delete a webhook.
Methods inherited from Sms77::Resource
get_endpoint, get_http_methods, #initialize
Constructor Details
This class inherits a constructor from Sms77::Resource
Instance Method Details
#read(params = {}) ⇒ Hash
Retrieve all webhooks
19 20 21 |
# File 'lib/sms77/resources/hooks.rb', line 19 def read(params = {}) request(params.merge({ :action => Sms77::Hooks::Action::READ })) end |
#subscribe(params) ⇒ Hash
Register a new webhook
26 27 28 29 30 |
# File 'lib/sms77/resources/hooks.rb', line 26 def subscribe(params) Sms77::Hooks::Validator::subscribe(params) request(params.merge({ :action => Sms77::Hooks::Action::SUBSCRIBE })) end |
#unsubscribe(params) ⇒ Hash
Delete a webhook
35 36 37 38 39 |
# File 'lib/sms77/resources/hooks.rb', line 35 def unsubscribe(params) Sms77::Hooks::Validator::unsubscribe(params) request(params.merge({ :action => Sms77::Hooks::Action::UNSUBSCRIBE })) end |