lib/suo/client/memcached.rb in suo-0.2.3 vs lib/suo/client/memcached.rb in suo-0.3.0

- old
+ new

@@ -1,28 +1,28 @@ module Suo module Client class Memcached < Base - def initialize(options = {}) + def initialize(key, options = {}) options[:client] ||= Dalli::Client.new(options[:connection] || ENV["MEMCACHE_SERVERS"] || "127.0.0.1:11211") super end - def clear(key) - @client.delete(key) + def clear + @client.delete(@key) end private - def get(key) - @client.get_cas(key) + def get + @client.get_cas(@key) end - def set(key, newval, cas) - @client.set_cas(key, newval, cas) + def set(newval, cas) + @client.set_cas(@key, newval, cas) end - def initial_set(key, val = "") - @client.set(key, val) + def initial_set(val = "") + @client.set(@key, val) end end end end