require 'redis' module Legion module Cache module Redis def connect @client = Redis.new end def close @client.close end def restart close connect end def get(key) @client[key] end def set(key, value) @client[key] = value end def delete(key) @client.del key end def flush @client.flushdb end end end end