Sha256: f7bcae86c7ed044caf39655d7006a4844d87c34c526301d1e743a4a544264796
Contents?: true
Size: 366 Bytes
Versions: 22
Compression:
Stored size: 366 Bytes
Contents
require 'redis' class Harmony::Service::Utils::Storage def get(key) json = redis.get(key) JSON.parse(json) if json end def set(key, value) redis.set(key, value.to_json) end def clear(key) redis.del(key) end private def redis @redis ||= Redis.new(url: redis_url) end def redis_url ENV['redis_url'] end end
Version data entries
22 entries across 22 versions & 1 rubygems