Parent

Class Index [+]

Quicksearch

Rack::Utils::Context

Context allows the use of a compatible middleware at different points in a request handling stack. A compatible middleware must define # 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.

Attributes

for[R]
app[R]

Public Class Methods

new(app_f, app_r) click to toggle source
     # File lib/rack/utils.rb, line 272
272:       def initialize(app_f, app_r)
273:         raise 'running context does not respond to #context' unless app_f.respond_to? :context
274:         @for, @app = app_f, app_r
275:       end

Public Instance Methods

call(env) click to toggle source
     # File lib/rack/utils.rb, line 277
277:       def call(env)
278:         @for.context(env, @app)
279:       end
context(env, app=@app) click to toggle source
     # File lib/rack/utils.rb, line 285
285:       def context(env, app=@app)
286:         recontext(app).call(env)
287:       end
recontext(app) click to toggle source
     # File lib/rack/utils.rb, line 281
281:       def recontext(app)
282:         self.class.new(@for, app)
283:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.