Class: Promenade::Pitchfork::Middleware
- Inherits:
-
Object
- Object
- Promenade::Pitchfork::Middleware
- Defined in:
- lib/promenade/pitchfork/middleware.rb
Constant Summary collapse
- RACK_AFTER_REPLY =
"rack.after_reply".freeze
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.
9 10 11 |
# File 'lib/promenade/pitchfork/middleware.rb', line 9 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/promenade/pitchfork/middleware.rb', line 13 def call(env) if env.key?(RACK_AFTER_REPLY) env[RACK_AFTER_REPLY] << -> { instrument } end @app.call(env) end |