Class: Fino::Rails::RequestScopedCache::Middleware
- Inherits:
-
Object
- Object
- Fino::Rails::RequestScopedCache::Middleware
- Defined in:
- lib/fino/rails/request_scoped_cache/middleware.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app, options = {}) ⇒ Middleware
Returns a new instance of Middleware.
4 5 6 7 |
# File 'lib/fino/rails/request_scoped_cache/middleware.rb', line 4 def initialize(app, = {}) @app = app @cache_wrapper_block = [:cache_wrapper_block] end |
Instance Method Details
#call(env) ⇒ Object
9 10 11 12 13 |
# File 'lib/fino/rails/request_scoped_cache/middleware.rb', line 9 def call(env) Fino::Rails::RequestScopedCache::Pipe.with_temporary_cache(@cache_wrapper_block) do @app.call(env) end end |