Class: ExceptionNotifier::DetailedSlackNotifier

Inherits:
Object
  • Object
show all
Defined in:
lib/exception_notifier/detailed_slack_notifier.rb

Overview

notifier plugin for Slack, implementing both initialize and call

Defined Under Namespace

Classes: DetailedSlackNotification

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ DetailedSlackNotifier

Returns a new instance of DetailedSlackNotifier.



7
8
9
10
# File 'lib/exception_notifier/detailed_slack_notifier.rb', line 7

def initialize(options = {})
  @webhook_url = options[:webhook_url]
  @notifier_options = options.select { |key, _value| %i(username channel).include?(key) }
end

Instance Method Details

#call(exception, options = {}) ⇒ Object



12
13
14
15
# File 'lib/exception_notifier/detailed_slack_notifier.rb', line 12

def call(exception, options = {})
  notification = DetailedSlackNotification.new(exception, options)
  slack_notifier.ping notification.message, attachments: notification.attachments
end