| Class | Rack::Utils::Context |
| In: |
lib/rack/utils.rb
|
| Parent: | Object |
Context allows the use of a compatible middleware at different points in a request handling stack. A compatible middleware must define context which should take the arguments env and app. The first of which would be the request environment. The second of which would be the rack application that the request would be forwarded to.
| app | [R] | |
| for | [R] |
# File lib/rack/utils.rb, line 168
168: def initialize(app_f, app_r)
169: raise 'running context does not respond to #context' unless app_f.respond_to? :context
170: @for, @app = app_f, app_r
171: end
# File lib/rack/utils.rb, line 181
181: def context(env, app=@app)
182: recontext(app).call(env)
183: end