Class: PumaAfterReply::Middleware
- Inherits:
-
Object
- Object
- PumaAfterReply::Middleware
- Defined in:
- lib/puma_after_reply/middleware.rb
Overview
Instance Method Summary collapse
-
#call(env) ⇒ Array
private
PumaAfterReply.call integration to the puma’s ‘rack.after_reply` env variable that is used for the “after reply” hook inside the puma’s request dispatching.
- #initialize(app) ⇒ void constructor private
Constructor Details
#initialize(app) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
11 12 13 |
# File 'lib/puma_after_reply/middleware.rb', line 11 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Array
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
PumaAfterReply.call integration to the puma’s ‘rack.after_reply` env variable that is used for the “after reply” hook inside the puma’s request dispatching.
23 24 25 26 27 28 29 30 31 |
# File 'lib/puma_after_reply/middleware.rb', line 23 def call(env) @app.call(env).tap do if env.key?('rack.after_reply') env['rack.after_reply'] << proc { PumaAfterReply.call } elsif PumaAfterReply::Config.run_anyway PumaAfterReply.call # NOTE: may be usefull for/from-inside test environments end end end |