Class: ExceptionNotifier::IrcNotifier
- Inherits:
-
BaseNotifier
- Object
- BaseNotifier
- ExceptionNotifier::IrcNotifier
- Defined in:
- lib/exception_notifier/irc_notifier.rb
Instance Attribute Summary
Attributes inherited from BaseNotifier
Instance Method Summary collapse
- #call(exception, options = {}) ⇒ Object
-
#initialize(options) ⇒ IrcNotifier
constructor
A new instance of IrcNotifier.
- #send_message(message) ⇒ Object
Methods inherited from BaseNotifier
#_post_callback, #_pre_callback, #send_notice
Constructor Details
#initialize(options) ⇒ IrcNotifier
Returns a new instance of IrcNotifier.
3 4 5 6 7 |
# File 'lib/exception_notifier/irc_notifier.rb', line 3 def initialize() super @config = OpenStruct.new () end |
Instance Method Details
#call(exception, options = {}) ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/exception_notifier/irc_notifier.rb', line 9 def call(exception, ={}) = "'#{exception.}'" += " on '#{exception.backtrace.first}'" if exception.backtrace if active? send_notice(exception, , ) do |msg, _| ([*@config.prefix, *msg].join(' ')) end end end |
#send_message(message) ⇒ Object
19 20 21 |
# File 'lib/exception_notifier/irc_notifier.rb', line 19 def () CarrierPigeon.send @config.irc.merge({message: }) end |