Class: ExceptionHunter::Notifiers::SlackNotifier
- Inherits:
-
Object
- Object
- ExceptionHunter::Notifiers::SlackNotifier
- Defined in:
- lib/exception_hunter/notifiers/slack_notifier.rb
Overview
Notifier that sends a message to a Slack channel every time an exception is tracked.
Instance Attribute Summary collapse
- #error ⇒ Object readonly
- #notifier ⇒ Object readonly
Instance Method Summary collapse
-
#initialize(error, notifier) ⇒ SlackNotifier
constructor
A new instance of SlackNotifier.
- #notify ⇒ Object
Constructor Details
#initialize(error, notifier) ⇒ SlackNotifier
Returns a new instance of SlackNotifier.
10 11 12 13 |
# File 'lib/exception_hunter/notifiers/slack_notifier.rb', line 10 def initialize(error, notifier) @error = error @notifier = notifier end |
Instance Attribute Details
#error ⇒ Object (readonly)
8 9 10 |
# File 'lib/exception_hunter/notifiers/slack_notifier.rb', line 8 def error @error end |
#notifier ⇒ Object (readonly)
8 9 10 |
# File 'lib/exception_hunter/notifiers/slack_notifier.rb', line 8 def notifier @notifier end |
Instance Method Details
#notify ⇒ Object
15 16 17 18 |
# File 'lib/exception_hunter/notifiers/slack_notifier.rb', line 15 def notify slack_notifier = Slack::Notifier.new(notifier[:options][:webhook]) slack_notifier.ping() end |