Class: CodeBuildNotifier::SlackMessage
- Inherits:
-
Object
- Object
- CodeBuildNotifier::SlackMessage
- Defined in:
- lib/codebuild-notifier/slack_message.rb
Instance Attribute Summary collapse
-
#build ⇒ Object
readonly
Returns the value of attribute build.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
- #additional_channel ⇒ Object
-
#initialize(build, config) ⇒ SlackMessage
constructor
A new instance of SlackMessage.
- #payload ⇒ Object
- #recipients ⇒ Object
Constructor Details
#initialize(build, config) ⇒ SlackMessage
Returns a new instance of SlackMessage.
25 26 27 28 |
# File 'lib/codebuild-notifier/slack_message.rb', line 25 def initialize(build, config) @build = build @config = config end |
Instance Attribute Details
#build ⇒ Object (readonly)
Returns the value of attribute build.
20 21 22 |
# File 'lib/codebuild-notifier/slack_message.rb', line 20 def build @build end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
20 21 22 |
# File 'lib/codebuild-notifier/slack_message.rb', line 20 def config @config end |
Instance Method Details
#additional_channel ⇒ Object
43 44 45 |
# File 'lib/codebuild-notifier/slack_message.rb', line 43 def additional_channel !build.for_pr? && config.additional_channel end |
#payload ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/codebuild-notifier/slack_message.rb', line 30 def payload { color: slack_color, fallback: [title, body].join("\n"), title: title, text: body } end |
#recipients ⇒ Object
39 40 41 |
# File 'lib/codebuild-notifier/slack_message.rb', line 39 def recipients [, committer_email].uniq end |