Sha256: bda6c68479fc8ff3021f7983f08aaf48e0eacba2307f24b2cb559225138ff274

Contents?: true

Size: 378 Bytes

Versions: 2

Compression:

Stored size: 378 Bytes

Contents

require "request_store/version"

require "request_store/railtie" if defined?(Rails)

module RequestStore
  def self.store
    Thread.current[:request_store] ||= {}
    Thread.current[:request_store]
  end

  class Middleware
    def initialize(app)
      @app = app
    end
    
    def call(env)
      Thread.current[:request_store] = {}
      @app.call(env)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
request_store-1.0.1 lib/request_store.rb
request_store-1.0.0 lib/request_store.rb