Class: Barbeque::SlackClient

Inherits:
Object
  • Object
show all
Defined in:
lib/barbeque/slack_client.rb

Instance Method Summary collapse

Constructor Details

#initialize(channel) ⇒ SlackClient

Returns a new instance of SlackClient.



7
8
9
# File 'lib/barbeque/slack_client.rb', line 7

def initialize(channel)
  @channel = channel
end

Instance Method Details

#notify_failure(message) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/barbeque/slack_client.rb', line 21

def notify_failure(message)
  post_slack(
    attachments: [{
      text: message,
      color: 'danger',
      mrkdwn_in: ['text'],
    }],
  )
end

#notify_success(message) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/barbeque/slack_client.rb', line 11

def notify_success(message)
  post_slack(
    attachments: [{
      text: message,
      color: 'good',
      mrkdwn_in: ['text'],
    }],
  )
end