Class: SimpleDeploy::Notifier::Slack

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_deploy/notifier/slack.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Slack

Returns a new instance of Slack.



7
8
9
10
# File 'lib/simple_deploy/notifier/slack.rb', line 7

def initialize(args = {})
  @logger = SimpleDeploy.logger
  @notifier = ::Slack::Notifier.new SimpleDeploy.config.notifications['slack']['webhook_url']
end

Instance Method Details

#send(message) ⇒ Object



12
13
14
15
16
# File 'lib/simple_deploy/notifier/slack.rb', line 12

def send(message)
  @logger.info "Sending Slack notification."
  @notifier.ping message
  @logger.info "Slack notification complete."
end