Sha256: e4123aa029a3b3d3a7cc2c4550235fa34c237492671fd0a31a9da8dbd25ec7f4

Contents?: true

Size: 429 Bytes

Versions: 2

Compression:

Stored size: 429 Bytes

Contents

# frozen_string_literal: true

module Renderful
  class Cache
    class Redis < Cache
      attr_reader :redis

      def initialize(redis)
        @redis = redis
      end

      def exist?(key)
        redis.exists(key)
      end

      def read(key)
        redis.get(key)
      end

      def write(key, value)
        redis.set(key, value)
      end

      def delete(key)
        redis.del(key)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
renderful-0.2.0 lib/renderful/cache/redis.rb
renderful-0.1.0 lib/renderful/cache/redis.rb