Class: Mandrill::Webhooks
- Inherits:
-
Object
- Object
- Mandrill::Webhooks
- Defined in:
- lib/mandrill/api.rb
Instance Attribute Summary collapse
-
#master ⇒ Object
Returns the value of attribute master.
Instance Method Summary collapse
-
#add(url, events = []) ⇒ Hash
Add a new webhook.
-
#delete(id) ⇒ Hash
Delete an existing webhook.
-
#info(id) ⇒ Hash
Given the ID of an existing webhook, return the data about it.
-
#initialize(master) ⇒ Webhooks
constructor
A new instance of Webhooks.
-
#list ⇒ Array
Get the list of all webhooks defined on the account.
-
#update(id, url, events = []) ⇒ Hash
Update an existing webhook.
Constructor Details
#initialize(master) ⇒ Webhooks
Returns a new instance of Webhooks.
750 751 752 |
# File 'lib/mandrill/api.rb', line 750 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
748 749 750 |
# File 'lib/mandrill/api.rb', line 748 def master @master end |
Instance Method Details
#add(url, events = []) ⇒ Hash
Add a new webhook
785 786 787 788 |
# File 'lib/mandrill/api.rb', line 785 def add(url, events=[]) _params = {:url => url, :events => events} return @master.call 'webhooks/add', _params end |
#delete(id) ⇒ Hash
Delete an existing webhook
839 840 841 842 |
# File 'lib/mandrill/api.rb', line 839 def delete(id) _params = {:id => id} return @master.call 'webhooks/delete', _params end |
#info(id) ⇒ Hash
Given the ID of an existing webhook, return the data about it
802 803 804 805 |
# File 'lib/mandrill/api.rb', line 802 def info(id) _params = {:id => id} return @master.call 'webhooks/info', _params end |
#list ⇒ Array
Get the list of all webhooks defined on the account
766 767 768 769 |
# File 'lib/mandrill/api.rb', line 766 def list() _params = {} return @master.call 'webhooks/list', _params end |
#update(id, url, events = []) ⇒ Hash
Update an existing webhook
822 823 824 825 |
# File 'lib/mandrill/api.rb', line 822 def update(id, url, events=[]) _params = {:id => id, :url => url, :events => events} return @master.call 'webhooks/update', _params end |