Class: Notificate::Rails::Rack
- Inherits:
-
Object
- Object
- Notificate::Rails::Rack
- Defined in:
- lib/notificate-rails/rack.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Rack
constructor
A new instance of Rack.
- #rack_data ⇒ Object
Constructor Details
#initialize(app) ⇒ Rack
Returns a new instance of Rack.
3 4 5 |
# File 'lib/notificate-rails/rack.rb', line 3 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/notificate-rails/rack.rb', line 7 def call(env) @env = env begin result = @app.call(env) rescue ::Exception => ex @env['notificate.notified'] = ::Notificate::ExceptionCatcher.notify(ex, rack_data) raise ex end result end |
#rack_data ⇒ Object
21 22 23 24 25 26 |
# File 'lib/notificate-rails/rack.rb', line 21 def rack_data { environment: ::Notificate::Rails..environment, root: ::Notificate::Rails..project_root } end |