Class: Rack::Norman
- Inherits:
-
Object
- Object
- Rack::Norman
- Defined in:
- lib/rack/norman.rb
Overview
Rack::Norman is a middleware that allows you to store a Norman datbase in a cookie.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Norman
constructor
A new instance of Norman.
Constructor Details
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/rack/norman.rb', line 13 def call(env) @norman.data = env["rack.cookies"]["norman_data"] @norman.load_database status, headers, body = @app.call(env) env["rack.cookies"]["norman_data"] = @norman.export_data [status, headers, body] end |