Class: InformantSinatra::Middleware
- Inherits:
-
Object
- Object
- InformantSinatra::Middleware
- Defined in:
- lib/informant-sinatra/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
3 4 5 |
# File 'lib/informant-sinatra/middleware.rb', line 3 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/informant-sinatra/middleware.rb', line 7 def call(env) InformantCommon::Client.start_transaction!(env['REQUEST_METHOD']) response = @app.call(env) InformantCommon::Client.current_transaction.handler = env['sinatra.route'] InformantCommon::Client.process response end |