class CheckAndNotify::Notifiers::Slack

Constants

HEADERS

Public Class Methods

notify(params) click to toggle source
# File lib/check_and_notify/notifiers/slack.rb, line 6
def self.notify(params)
  @slack_webhook_url = params[:slack_webhook_url]
  @message = params[:message]

  post
end

Private Class Methods

post() click to toggle source
# File lib/check_and_notify/notifiers/slack.rb, line 15
def self.post
  body = {text: @message}.to_json

  HTTParty.post(@slack_webhook_url,
    headers: HEADERS,
    body: body,
  )
end