Sha256: aa3fd2712e2da0ca4c03f3324fadfd6d63ff763e6f61a0bb7db08b80fa5ee626

Contents?: true

Size: 254 Bytes

Versions: 94

Compression:

Stored size: 254 Bytes

Contents

module NexmoDeveloper
  class VisitorId
    def initialize(app)
      @app = app
    end

    def call(env)
      req = Rack::Request.new(env)
      req.session['visitor_id'] ||= "G-#{SecureRandom.alphanumeric(8)}"
      @app.call(env)
    end
  end
end

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
station-0.4.6 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.4.5 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.4.4 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.4.3 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.4.2 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.4.1 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.4.0 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.3.2 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.3.1 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.3.0 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.2.6 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.2.5 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.2.4 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.2.3 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.2.2 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.2.1 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.2.0 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.1.8 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.1.7 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb
station-0.1.6 lib/nexmo_developer/app/middleware/nexmo_developer/visitor_id.rb