Sha256: 5decde8d45c4a48109e3bff81e2ee64ea99f469f4d424ca126609b91b47fccb8

Contents?: true

Size: 336 Bytes

Versions: 1

Compression:

Stored size: 336 Bytes

Contents

require "request_store/version"

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

module RequestStore
  def self.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

1 entries across 1 versions & 1 rubygems

Version Path
request_store-1.0.2 lib/request_store.rb