Module: AwsCleaner::Notify

Defined in:
lib/aws-cleaner.rb

Class Method Summary collapse

Class Method Details

.notify_chat(msg, config) ⇒ Object

generic chat notification method



128
129
130
131
132
# File 'lib/aws-cleaner.rb', line 128

def self.notify_chat(msg, config)
  if config[:slack][:enable]
    notify_slack(msg, config)
  end
end

.notify_slack(msg, config) ⇒ Object

notify slack



119
120
121
122
123
124
125
# File 'lib/aws-cleaner.rb', line 119

def self.notify_slack(msg, config)
  slack = Slack::Poster.new(config[:slack][:webhook_url])
  slack.channel = config[:slack][:channel]
  slack.username = config[:slack][:username] ||= 'aws-cleaner'
  slack.icon_emoji = config[:slack][:icon_emoji] ||= nil
  slack.send_message(msg)
end