Class: ExceptionNotifier::DetailedSlackNotifier
- Inherits:
-
Object
- Object
- ExceptionNotifier::DetailedSlackNotifier
- 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
- #call(exception, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ DetailedSlackNotifier
constructor
A new instance of DetailedSlackNotifier.
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( = {}) @webhook_url = [:webhook_url] @notifier_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, = {}) notification = DetailedSlackNotification.new(exception, ) slack_notifier.ping notification., attachments: notification. end |