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