Class: ExceptionNotifier::IrcNotifier
- Inherits:
-
Object
- Object
- ExceptionNotifier::IrcNotifier
- Defined in:
- lib/exception_notifier/irc_notifier.rb
Instance Method Summary collapse
- #call(exception, options = {}) ⇒ Object
-
#initialize(options) ⇒ IrcNotifier
constructor
A new instance of IrcNotifier.
- #send_message(message) ⇒ Object
Constructor Details
#initialize(options) ⇒ IrcNotifier
Returns a new instance of IrcNotifier.
3 4 5 6 |
# File 'lib/exception_notifier/irc_notifier.rb', line 3 def initialize() @config = OpenStruct.new () end |
Instance Method Details
#call(exception, options = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/exception_notifier/irc_notifier.rb', line 8 def call(exception, ={}) = "'#{exception.}'" += " on '#{exception.backtrace.first}'" if exception.backtrace ([*@config.prefix, *].join(' ')) if active? end |
#send_message(message) ⇒ Object
14 15 16 |
# File 'lib/exception_notifier/irc_notifier.rb', line 14 def () CarrierPigeon.send @config.irc.merge({message: }) end |