lib/suo/client/redis.rb in suo-0.1.3 vs lib/suo/client/redis.rb in suo-0.2.0
- old
+ new
@@ -4,40 +4,37 @@
def initialize(options = {})
options[:client] ||= ::Redis.new(options[:connection] || {})
super
end
- class << self
- def clear(key, options = {})
- options = merge_defaults(options)
- options[:client].del(key)
- end
+ def clear(key)
+ @client.del(key)
+ end
- private
+ private
- def get(key, options)
- [options[:client].get(key), nil]
- end
+ def get(key)
+ [@client.get(key), nil]
+ end
- def set(key, newval, _, options)
- ret = options[:client].multi do |multi|
- multi.set(key, newval)
- end
-
- ret[0] == "OK"
+ def set(key, newval, _)
+ ret = @client.multi do |multi|
+ multi.set(key, newval)
end
- def synchronize(key, options)
- options[:client].watch(key) do
- yield
- end
- ensure
- options[:client].unwatch
- end
+ ret[0] == "OK"
+ end
- def set_initial(key, options)
- options[:client].set(key, "")
+ def synchronize(key)
+ @client.watch(key) do
+ yield
end
+ ensure
+ @client.unwatch
+ end
+
+ def set_initial(key)
+ @client.set(key, "")
end
end
end
end