Class: Almaz::Capture
- Inherits:
-
Object
- Object
- Almaz::Capture
- Defined in:
- lib/almaz.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Capture
constructor
A new instance of Capture.
Constructor Details
#initialize(app) ⇒ Capture
Returns a new instance of Capture.
22 23 24 25 |
# File 'lib/almaz.rb', line 22 def initialize(app) @app = app @r = Redis.new(Almaz.redis_config) end |
Instance Method Details
#call(env) ⇒ Object
27 28 29 30 |
# File 'lib/almaz.rb', line 27 def call(env) @r.push_tail("almaz::#{Almaz.session_variable}::#{env['rack.session'][Almaz.session_variable]}", "#{Time.now.to_s} #{env['REQUEST_METHOD']} #{env['PATH_INFO']} #{env['QUERY_STRING']}#{env['rack.request.form_hash'].inspect}") rescue nil @app.call(env) end |