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, description = nil, 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, description = nil, events = []) ⇒ Hash
Update an existing webhook.
Constructor Details
#initialize(master) ⇒ Webhooks
Returns a new instance of Webhooks.
1498 1499 1500 |
# File 'lib/mandrill/api.rb', line 1498 def initialize(master) @master = master end |
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
1496 1497 1498 |
# File 'lib/mandrill/api.rb', line 1496 def master @master end |
Instance Method Details
#add(url, description = nil, events = []) ⇒ Hash
Add a new webhook
1538 1539 1540 1541 |
# File 'lib/mandrill/api.rb', line 1538 def add(url, description=nil, events=[]) _params = {:url => url, :description => description, :events => events} return @master.call 'webhooks/add', _params end |
#delete(id) ⇒ Hash
Delete an existing webhook
1599 1600 1601 1602 |
# File 'lib/mandrill/api.rb', line 1599 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
1557 1558 1559 1560 |
# File 'lib/mandrill/api.rb', line 1557 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
1516 1517 1518 1519 |
# File 'lib/mandrill/api.rb', line 1516 def list() _params = {} return @master.call 'webhooks/list', _params end |
#update(id, url, description = nil, events = []) ⇒ Hash
Update an existing webhook
1580 1581 1582 1583 |
# File 'lib/mandrill/api.rb', line 1580 def update(id, url, description=nil, events=[]) _params = {:id => id, :url => url, :description => description, :events => events} return @master.call 'webhooks/update', _params end |