Sha256: e2b4a387e2adbc5509a3c66b8b56ae1be3af0d01cf368c7b1faef7e47a110e36
Contents?: true
Size: 411 Bytes
Versions: 1
Compression:
Stored size: 411 Bytes
Contents
require 'cachy/wrapper' require 'yaml' class Cachy::RedisWrapper < Cachy::Wrapper def read(key) result = @wrapped.get(key) return if result.nil? YAML.load(result) end 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 def delete(key) @wrapped.del(key) end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
cachy-0.4.2 | lib/cachy/redis_wrapper.rb |