Sha256: b0ee5086297cd67b9b454d844928e6d54a127237ede09eec53f411ac897c07b3
Contents?: true
Size: 406 Bytes
Versions: 9
Compression:
Stored size: 406 Bytes
Contents
require 'cachy/wrapper' require 'yaml' class Cachy::RedisWrapper < Cachy::Wrapper def read(key) result = @wrapped[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
9 entries across 9 versions & 1 rubygems