Sha256: dd577f442f9ecad031eb41d61fcbcd4e8456c978423bf0b4951f90056c2a4e67

Contents?: true

Size: 471 Bytes

Versions: 11

Compression:

Stored size: 471 Bytes

Contents

module FFlags
  # Redis Client
  class RedisClient
    class << self
      def set(key, field, value)
        client.hmset(key, field, value) == 'OK'
      end

      def all(key)
        client.hgetall(key)
      end

      def get(key, field)
        client.hget(key, field)
      end

      def reset(key)
        client.del(key)
      end

      private

      def client
        @client ||= Redis.new(url: FFlags.configuration.redis_url)
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
fflags-0.4.4 lib/fflags/redis_client.rb
fflags-0.4.3 lib/fflags/redis_client.rb
fflags-0.4.2 lib/fflags/redis_client.rb
fflags-0.4.1 lib/fflags/redis_client.rb
fflags-0.4.0 lib/fflags/redis_client.rb
fflags-0.3.5 lib/fflags/redis_client.rb
fflags-0.3.4 lib/fflags/redis_client.rb
fflags-0.3.3 lib/fflags/redis_client.rb
fflags-0.3.2 lib/fflags/redis_client.rb
fflags-0.3.1 lib/fflags/redis_client.rb
fflags-0.3.0 lib/fflags/redis_client.rb