Class: KapostDeploy::Slack::Notifier

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

Overview

Wrapper for slack-notify gem

Instance Method Summary collapse

Constructor Details

#initialize(slack_config) ⇒ Notifier

Returns a new instance of Notifier.



9
10
11
# File 'lib/kapost_deploy/slack/notifier.rb', line 9

def initialize(slack_config)
  self.slack_config = slack_config
end

Instance Method Details

#configured?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/kapost_deploy/slack/notifier.rb', line 18

def configured?
  !slack_config.nil?
end

#notify(message) ⇒ Object



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

def notify(message)
  return unless configured?
  slack.notify(message)
end