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.
Run setup and call the app
# File lib/innate/current.rb, line 20 def call(env) setup(env) @app.call(env) end
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 def setup(env, request = Request, response = Response, session = Session) current = Thread.current req = current[:request] = request.new(env) res = current[:response] = response.new current[:actions] = [] current[:session] = Session.new(req, res) end
Generated with the Darkfish Rdoc Generator 2.