Parent

Methods

Innate::Current

We track the current request/response/session (Trinity) in Thread.current so we can reach them from anywhere in the code without passing around the objects directly.

Public Class Methods

new(app, *rest) click to toggle source
    # File lib/innate/current.rb, line 11
11:     def initialize(app, *rest)
12:       if rest.empty?
13:         @app = app
14:       else
15:         @app = Rack::Cascade.new([app, *rest])
16:       end
17:     end

Public Instance Methods

call(env) click to toggle source

Run setup and call the app

    # File lib/innate/current.rb, line 20
20:     def call(env)
21:       setup(env)
22:       @app.call(env)
23:     end
setup(env, request = Request, response = Response, session = Session) click to toggle source

Setup new Request/Response/Session for this request/response cycle. The parameters are here to allow Ramaze to inject its own classes.

    # File lib/innate/current.rb, line 27
27:     def setup(env, request = Request, response = Response, session = Session)
28:       current = Thread.current
29:       req = current[:request] = request.new(env)
30:       res = current[:response] = response.new
31:       current[:actions] = []
32:       current[:session] = Session.new(req, res)
33:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.