Class: HookSniff::Alert
- Inherits:
-
Object
- Object
- HookSniff::Alert
- Defined in:
- lib/hooksniff/api/alert.rb
Instance Method Summary collapse
- #create(attrs) ⇒ Object
- #delete(id) ⇒ Object
- #get(id) ⇒ Object
-
#initialize(client) ⇒ Alert
constructor
A new instance of Alert.
- #list ⇒ Object
- #test(id) ⇒ Object
- #update(id, attrs) ⇒ Object
Constructor Details
#initialize(client) ⇒ Alert
Returns a new instance of Alert.
5 6 7 |
# File 'lib/hooksniff/api/alert.rb', line 5 def initialize(client) @client = client end |
Instance Method Details
#create(attrs) ⇒ Object
17 18 19 |
# File 'lib/hooksniff/api/alert.rb', line 17 def create(attrs) @client.execute_request("POST", "/v1/alerts", body: attrs) end |
#delete(id) ⇒ Object
25 26 27 28 |
# File 'lib/hooksniff/api/alert.rb', line 25 def delete(id) @client.execute_request("DELETE", "/v1/alerts/#{id}") nil end |
#get(id) ⇒ Object
13 14 15 |
# File 'lib/hooksniff/api/alert.rb', line 13 def get(id) @client.execute_request("GET", "/v1/alerts/#{id}") end |
#list ⇒ Object
9 10 11 |
# File 'lib/hooksniff/api/alert.rb', line 9 def list @client.execute_request("GET", "/v1/alerts") end |
#test(id) ⇒ Object
30 31 32 |
# File 'lib/hooksniff/api/alert.rb', line 30 def test(id) @client.execute_request("POST", "/v1/alerts/#{id}/test") end |
#update(id, attrs) ⇒ Object
21 22 23 |
# File 'lib/hooksniff/api/alert.rb', line 21 def update(id, attrs) @client.execute_request("PUT", "/v1/alerts/#{id}", body: attrs) end |