Class: CodeBuildNotifier::SlackSender
- Inherits:
-
Object
- Object
- CodeBuildNotifier::SlackSender
- Defined in:
- lib/codebuild-notifier/slack_sender.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config) ⇒ SlackSender
constructor
A new instance of SlackSender.
- #send(message) ⇒ Object
Constructor Details
#initialize(config) ⇒ SlackSender
Returns a new instance of SlackSender.
25 26 27 |
# File 'lib/codebuild-notifier/slack_sender.rb', line 25 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
23 24 25 |
# File 'lib/codebuild-notifier/slack_sender.rb', line 23 def config @config end |
Instance Method Details
#send(message) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/codebuild-notifier/slack_sender.rb', line 29 def send() Slack.configure { |slack_config| slack_config.token = app_token } channel = .additional_channel if channel channel = "##{channel}" unless /\A#/.match?(channel) (, channel) end .recipients.each do |email| slack_user_id = find_slack_user(email) slack_user_id && (, slack_user_id) end end |