Class: Phishin::Client::MemcachedCache

Inherits:
Object
  • Object
show all
Defined in:
lib/phishin/client/cache.rb

Instance Method Summary collapse

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