Class: FFlags::RedisClient

Inherits:
Object
  • Object
show all
Defined in:
lib/fflags/redis_client.rb

Overview

Redis Client

Class Method Summary collapse

Class Method Details

.all(key) ⇒ Object



12
13
14
# File 'lib/fflags/redis_client.rb', line 12

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

.get(key, field) ⇒ Object



16
17
18
# File 'lib/fflags/redis_client.rb', line 16

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

.reset(key) ⇒ Object



20
21
22
# File 'lib/fflags/redis_client.rb', line 20

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

.set(key, field, value) ⇒ Object

hset doesn’t return explicitly true or false



6
7
8
9
10
# File 'lib/fflags/redis_client.rb', line 6

def set(key, field, value)
  return false if value.nil?

  client.hset(key, field, value.to_s)
end