Class: CheckAndNotify::Notifiers::Slack
- Inherits:
-
Object
- Object
- CheckAndNotify::Notifiers::Slack
- Defined in:
- lib/check_and_notify/notifiers/slack.rb
Constant Summary collapse
- HEADERS =
{'Content-Type' => 'application/json'}
Class Method Summary collapse
Class Method Details
.notify(params) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/check_and_notify/notifiers/slack.rb', line 6 def self.notify(params) @slack_webhook_url = params[:slack_webhook_url] = params[:message] post end |
.post ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/check_and_notify/notifiers/slack.rb', line 15 def self.post body = {text: }.to_json HTTParty.post(@slack_webhook_url, headers: HEADERS, body: body, ) end |