Module: Sinatra::RedisCache
- Defined in:
- lib/sinatra/redis-cache.rb
Defined Under Namespace
Modules: Config
Classes: RedisCache
Instance Method Summary
collapse
Instance Method Details
#cache_do(key, expires = nil, params = {}, &block) ⇒ Object
113
114
115
116
|
# File 'lib/sinatra/redis-cache.rb', line 113
def cache_do(key, expires=nil, params={}, &block)
cache = RedisCache.new
cache.do(key, expires, params, block)
end
|
#cache_flush ⇒ Object
128
129
130
131
|
# File 'lib/sinatra/redis-cache.rb', line 128
def cache_flush
cache = RedisCache.new
cache.flush
end
|
#cache_get(key, params = {}) ⇒ Object
118
119
120
121
|
# File 'lib/sinatra/redis-cache.rb', line 118
def cache_get(key, params={})
cache = RedisCache.new
cache.get(key, params)
end
|
#cache_store(key, value, expires, params = {}) ⇒ Object
123
124
125
126
|
# File 'lib/sinatra/redis-cache.rb', line 123
def cache_store(key, value, expires, params={})
cache = RedisCache.new
cache.store(key, value, expires, params)
end
|