Class: Stenographer::Outputs::SlackOutput
Constant Summary
collapse
- BASE_URI =
'https://slack.com/api/'
Instance Method Summary
collapse
Methods inherited from BaseOutput
#initialize
Instance Method Details
#channels ⇒ Object
8
9
10
11
12
|
# File 'lib/stenographer/outputs/slack_output.rb', line 8
def channels
result = get_request(endpoint: 'channels.list', params: { token: token, exclude_archived: true, exclude_members: true })
channels_data = result[:channels]
channels_data.map { |channel| [channel[:name], channel[:id]] }
end
|
#send ⇒ Object
14
15
16
17
18
19
20
21
22
|
# File 'lib/stenographer/outputs/slack_output.rb', line 14
def send
raise StandardError, 'you must pass a Change to send' if @change.blank?
post_json_request(endpoint: 'chat.postMessage', params: {
channel: configuration[:channel],
text: "Deployed updates to *#{@change.environments.upcase}*:",
attachments: [generate_attachment]
})
end
|