Class: Capistrano3::Notification::Slack

Inherits:
Adapter
  • Object
show all
Defined in:
lib/capistrano3/notification/slack.rb

Instance Attribute Summary

Attributes inherited from Adapter

#env

Instance Method Summary collapse

Methods inherited from Adapter

#initialize

Constructor Details

This class inherits a constructor from Capistrano3::Notification::Adapter

Instance Method Details

#notify(message) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/capistrano3/notification/slack.rb', line 6

def notify(message)
  notifier_options = { username: user, channel: channel }.reject { |_x, y| y.nil? }
  ping_options = {}.tap do |h|
    h[icon_type] = icon if icon_type
  end
  ::Slack::Notifier.new(webhook_url, notifier_options).ping message, ping_options
end