Class: Bugsnag::Middleware::Callbacks
- Inherits:
-
Object
- Object
- Bugsnag::Middleware::Callbacks
- Defined in:
- lib/bugsnag/middleware/callbacks.rb
Instance Method Summary collapse
- #call(notification) ⇒ Object
-
#initialize(bugsnag) ⇒ Callbacks
constructor
A new instance of Callbacks.
Constructor Details
#initialize(bugsnag) ⇒ Callbacks
Returns a new instance of Callbacks.
3 4 5 |
# File 'lib/bugsnag/middleware/callbacks.rb', line 3 def initialize(bugsnag) @bugsnag = bugsnag end |
Instance Method Details
#call(notification) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/bugsnag/middleware/callbacks.rb', line 7 def call(notification) if notification.request_data[:before_callbacks] notification.request_data[:before_callbacks].each {|c| c.call(*[notification][0...c.arity]) } end @bugsnag.call(notification) if notification.request_data[:after_callbacks] notification.request_data[:after_callbacks].each {|c| c.call(*[notification][0...c.arity]) } end end |