instance method
middleware
Ruby on Rails 2.3.18
Since v2.3.18Signature
middleware()
No documentation comment.
Source
# File activesupport/lib/active_support/cache/strategy/local_cache.rb, line 15
def middleware
@middleware ||= begin
klass = Class.new
klass.class_eval(<<-EOS, __FILE__, __LINE__ + 1)
def initialize(app)
@app = app
end
def call(env)
Thread.current[:#{thread_local_key}] = MemoryStore.new
@app.call(env)
ensure
Thread.current[:#{thread_local_key}] = nil
end
EOS
klass
end
end
Defined in activesupport/lib/active_support/cache/strategy/local_cache.rb line 15
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActiveSupport::Cache::Strategy::LocalCache