Class: GetFluxly::Rails::Middleware
- Inherits:
-
Object
- Object
- GetFluxly::Rails::Middleware
- Defined in:
- lib/getfluxly/rails.rb
Overview
Constant Summary collapse
- COOKIE =
"gflux_anon"
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
45 46 47 |
# File 'lib/getfluxly/rails.rb', line 45 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
49 50 51 52 53 54 |
# File 'lib/getfluxly/rails.rb', line 49 def call(env) = env["HTTP_COOKIE"].to_s match = .match(/(?:^|;\s*)#{COOKIE}=([^;]+)/) env["gflux.anonymous_id"] = match[1] if match @app.call(env) end |