require 'redis' module Riedi class Storage def initialize(options = {}) @options = options end def flushall redis.flushall end def status begin redis.randomkey "OK" rescue "NG" end end def keys redis.keys end def set(key, value) redis.set(key, value) end def get(key) redis.get(key) end def del(key) redis.del(key) end private def redis @redis ||= Redis.new(@options) end end end