Sha256: 0489ee6a5e46e5460c32f4a0adf39088bb7185e6ea66d07a7cc9fb224d126c9a

Contents?: true

Size: 494 Bytes

Versions: 1

Compression:

Stored size: 494 Bytes

Contents

module FFlags
  # Redis Client
  class RedisClient
    # hset doesn't return explicitly true or false
    def set(key, field, value)
      return false if value.nil?

      client.hset(key, field, value.to_s)
    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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fflags-0.5.1 lib/fflags/redis_client.rb