Class: Mandrill::Webhooks

Inherits:
Object
  • Object
show all
Defined in:
lib/mandrill/api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(master) ⇒ Webhooks



1697
1698
1699
# File 'lib/mandrill/api.rb', line 1697

def initialize(master)
    @master = master
end

Instance Attribute Details

#masterObject

Returns the value of attribute master.



1695
1696
1697
# File 'lib/mandrill/api.rb', line 1695

def master
  @master
end

Instance Method Details

#add(url, description = nil, events = []) ⇒ Hash

Add a new webhook



1737
1738
1739
1740
# File 'lib/mandrill/api.rb', line 1737

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



1798
1799
1800
1801
# File 'lib/mandrill/api.rb', line 1798

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



1756
1757
1758
1759
# File 'lib/mandrill/api.rb', line 1756

def info(id)
    _params = {:id => id}
    return @master.call 'webhooks/info', _params
end

#listArray

Get the list of all webhooks defined on the account



1715
1716
1717
1718
# File 'lib/mandrill/api.rb', line 1715

def list()
    _params = {}
    return @master.call 'webhooks/list', _params
end

#update(id, url, description = nil, events = []) ⇒ Hash

Update an existing webhook



1779
1780
1781
1782
# File 'lib/mandrill/api.rb', line 1779

def update(id, url, description=nil, events=[])
    _params = {:id => id, :url => url, :description => description, :events => events}
    return @master.call 'webhooks/update', _params
end