Class: PeakFlowUtils::NotifierRack
- Inherits:
-
Object
- Object
- PeakFlowUtils::NotifierRack
- Defined in:
- lib/peak_flow_utils/notifier_rack.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ NotifierRack
constructor
A new instance of NotifierRack.
Constructor Details
#initialize(app, options = {}) ⇒ NotifierRack
Returns a new instance of NotifierRack.
2 3 4 5 |
# File 'lib/peak_flow_utils/notifier_rack.rb', line 2 def initialize(app, = {}) @app = app @options = end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/peak_flow_utils/notifier_rack.rb', line 7 def call(env) @app.call(env) rescue Exception => e # rubocop:disable Lint/RescueException controller = env["action_controller.instance"] request = controller&.request PeakFlowUtils::Notifier.with_parameters(rack: {get: request.GET, post: request.POST}) do PeakFlowUtils::Notifier.notify( environment: env, error: e ) end raise e end |