Class: ExceptionNotifier::BaseNotifier
- Inherits:
-
Object
- Object
- ExceptionNotifier::BaseNotifier
- Defined in:
- lib/exception_notifier/base_notifier.rb
Direct Known Subclasses
CampfireNotifier, EmailNotifier, HipchatNotifier, IrcNotifier, SlackNotifier, WebhookNotifier
Instance Attribute Summary collapse
-
#base_options ⇒ Object
Returns the value of attribute base_options.
Instance Method Summary collapse
- #_post_callback(exception, options, message, message_opts) ⇒ Object
- #_pre_callback(exception, options, message, message_opts) ⇒ Object
-
#initialize(options = {}) ⇒ BaseNotifier
constructor
A new instance of BaseNotifier.
- #send_notice(exception, options, message, message_opts = nil) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ BaseNotifier
Returns a new instance of BaseNotifier.
5 6 7 |
# File 'lib/exception_notifier/base_notifier.rb', line 5 def initialize(={}) @base_options = end |
Instance Attribute Details
#base_options ⇒ Object
Returns the value of attribute base_options.
3 4 5 |
# File 'lib/exception_notifier/base_notifier.rb', line 3 def @base_options end |
Instance Method Details
#_post_callback(exception, options, message, message_opts) ⇒ Object
20 21 22 |
# File 'lib/exception_notifier/base_notifier.rb', line 20 def _post_callback(exception, , , ) @base_options[:post_callback].call(, self, exception.backtrace, , ) if @base_options[:post_callback].respond_to?(:call) end |
#_pre_callback(exception, options, message, message_opts) ⇒ Object
16 17 18 |
# File 'lib/exception_notifier/base_notifier.rb', line 16 def _pre_callback(exception, , , ) @base_options[:pre_callback].call(, self, exception.backtrace, , ) if @base_options[:pre_callback].respond_to?(:call) end |
#send_notice(exception, options, message, message_opts = nil) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/exception_notifier/base_notifier.rb', line 9 def send_notice(exception, , , =nil) _pre_callback(exception, , , ) result = yield(, ) _post_callback(exception, , , ) result end |