Sha256: 2a350555ff0943cdf159e57278b5e13d6261dcac716af0c82c155a7d85b6c8c3

Contents?: true

Size: 370 Bytes

Versions: 1

Compression:

Stored size: 370 Bytes

Contents

require 'rack/null_session/version'
module Rack
  class NullSession

    class DumbHash < Hash
      def []= key,value
        super key.to_s, value
      end
      def [] key
        super key.to_s
      end
    end

    def initialize app
      @app = app
    end

    def call env
      @app.call( ({ "rack.session" => DumbHash.new }).merge(env) )
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rack-nullsession-1.0.0 lib/rack/null_session.rb