Class: Phishin::Client::MemcachedCache
- Inherits:
-
Object
- Object
- Phishin::Client::MemcachedCache
- Defined in:
- lib/phishin/client/cache.rb
Instance Method Summary collapse
- #delete(key) ⇒ Object
- #get(key) ⇒ Object
-
#initialize(opts = {}) ⇒ MemcachedCache
constructor
A new instance of MemcachedCache.
- #set(key, value, ttl = nil) ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ MemcachedCache
Returns a new instance of MemcachedCache.
110 111 112 113 114 |
# File 'lib/phishin/client/cache.rb', line 110 def initialize(opts={}) expires_in = opts[:expires_in] || nil servers = opts[:servers] @client = Dalli::Client.new(servers, namespace: Cache::CACHE_NAMESPACE, expires_in: expires_in) end |
Instance Method Details
#delete(key) ⇒ Object
123 124 |
# File 'lib/phishin/client/cache.rb', line 123 def delete(key) end |
#get(key) ⇒ Object
116 117 |
# File 'lib/phishin/client/cache.rb', line 116 def get(key) end |
#set(key, value, ttl = nil) ⇒ Object
119 120 121 |
# File 'lib/phishin/client/cache.rb', line 119 def set(key, value, ttl=nil) @client.set(key, value, ttl) end |