Sha256: 2b01a782804f4cdd82e55326adc456ed01483a3f7a1f000fc8d424f2d5852efe

Contents?: true

Size: 420 Bytes

Versions: 9

Compression:

Stored size: 420 Bytes

Contents

require "redis"

module Socrates
  module Storage
    class Redis
      def initialize(url: "redis://localhost")
        @redis = ::Redis.new(url: url)
      end

      def has_key?(key)
        @redis.exists(key)
      end

      def clear(key)
        @redis.del(key)
      end

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

      def put(key, value)
        @redis.set(key, value)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
socrates-0.1.18 lib/socrates/storage/redis.rb
socrates-0.1.17 lib/socrates/storage/redis.rb
socrates-0.1.16 lib/socrates/storage/redis.rb
socrates-0.1.15 lib/socrates/storage/redis.rb
socrates-0.1.14 lib/socrates/storage/redis.rb
socrates-0.1.13 lib/socrates/storage/redis.rb
socrates-0.1.12 lib/socrates/storage/redis.rb
socrates-0.1.11 lib/socrates/storage/redis.rb
socrates-0.1.10 lib/socrates/storage/redis.rb