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 347
347:       def initialize(app_f, app_r)
348:         raise 'running context does not respond to #context' unless app_f.respond_to? :context
349:         @for, @app = app_f, app_r
350:       end

Public Instance Methods

call(env) click to toggle source
     # File lib/rack/utils.rb, line 352
352:       def call(env)
353:         @for.context(env, @app)
354:       end
context(env, app=@app) click to toggle source
     # File lib/rack/utils.rb, line 360
360:       def context(env, app=@app)
361:         recontext(app).call(env)
362:       end
recontext(app) click to toggle source
     # File lib/rack/utils.rb, line 356
356:       def recontext(app)
357:         self.class.new(@for, app)
358:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.