| Class | Rack::MonetaStore |
| In: |
lib/rack/moneta_store.rb
|
| Parent: | Object |
A Rack middleware that inserts a Moneta store in the environment and supports per-request caching via the the option `:cache => true`.
@example config.ru
# Add Rack::MonetaStore somewhere in your rack stack
use Rack::MonetaStore, :Memory, :cache => true
run lambda { |env|
env['rack.moneta_store'] # is a Moneta store with per-request caching
}
@example config.ru
# Pass it a block like the one passed to Moneta.build
use Rack::MonetaStore do
use :Transformer, :value => :zlib
adapter :Cookie
end
run lambda { |env|
env['rack.moneta_store'] # is a Moneta store without caching
}
@api public