Sha256: 1547ba6d3b066d7c2354e0aa8b43e15c76a651065cc969715a89d620b2860114
Contents?: true
Size: 668 Bytes
Versions: 5
Compression:
Stored size: 668 Bytes
Contents
class Redis module Helpers module Serialize include Marshal def to_redis(value, marshal=false) return value unless options[:marshal] || marshal case value when String, Fixnum, Bignum, Float value else dump(value) end end def from_redis(value, marshal=false) return value unless options[:marshal] || marshal case value when Array value.collect{|v| from_redis(v)} when Hash value.inject({}) { |h, (k, v)| h[k] = from_redis(v); h } else restore(value) rescue value end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems