Class: LiveQA::Plugins::Rack::Middleware
- Inherits:
-
Object
- Object
- LiveQA::Plugins::Rack::Middleware
- Defined in:
- lib/liveqa/plugins/rack/middleware.rb
Overview
LiveQA Plugins Rack Middleware
Middleware for Rack
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.
13 14 15 |
# File 'lib/liveqa/plugins/rack/middleware.rb', line 13 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/liveqa/plugins/rack/middleware.rb', line 17 def call(env) request = ::Rack::Request.new(env) store_tracker(request) store_request_data(request, env) LiveQA::Plugins::Rails::MiddlewareData.store_data(request) if defined?(::Rails) status, headers, body = @app.call(env) (headers, env) [status, headers, body] ensure LiveQA::Store.clear! end |