class Cachy::RedisWrapper

Public Instance Methods

delete(key) click to toggle source
# File lib/cachy/redis_wrapper.rb, line 17
def delete(key)
  @wrapped.del(key)
end
read(key) click to toggle source
# File lib/cachy/redis_wrapper.rb, line 5
def read(key)
  result = @wrapped.get(key)
  return if result.nil?
  YAML.load(result)
end
write(key, value, options={}) click to toggle source
# File lib/cachy/redis_wrapper.rb, line 11
def write(key, value, options={})
  result = @wrapped.set(key, value.to_yaml)
  @wrapped.expire(key, options[:expires_in].to_i) if options[:expires_in]
  result
end