Class: Rack::Cache::EntityStore::RedisBase

Inherits:
Rack::Cache::EntityStore show all
Extended by:
Utils
Defined in:
lib/rack/cache/redis_entitystore.rb

Direct Known Subclasses

Redis

Constant Summary

Constants inherited from Rack::Cache::EntityStore

REDIS

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cacheObject (readonly)

The underlying ::Redis instance used to communicate with the Redis daemon.



6
7
8
# File 'lib/rack/cache/redis_entitystore.rb', line 6

def cache
  @cache
end

Class Method Details

.resolve(uri) ⇒ Object



15
16
17
18
19
20
# File 'lib/rack/cache/redis_entitystore.rb', line 15

def self.resolve(uri)
  db = uri.path.sub(/^\//, '')
  db = "0" if db.empty?
  server = { :host => uri.host, :port => uri.port || "6379", :db => db }
  new server
end

Instance Method Details

#open(key) ⇒ Object



10
11
12
13
# File 'lib/rack/cache/redis_entitystore.rb', line 10

def open(key)
  data = read(key)
  data && [data]
end