Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: cfbadd9121
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (29 sloc) 0.629 kb
require 'set'
require 'redis'
module Flipper
module Adapters
class Redis
def initialize(client)
@client = client
end
def read(key)
@client.get key.to_s
end
def write(key, value)
@client.set key.to_s, value
end
def delete(key)
@client.del key.to_s
end
def set_add(key, value)
@client.sadd(key.to_s, value)
end
def set_delete(key, value)
@client.srem(key.to_s, value)
end
def set_members(key)
@client.smembers(key.to_s).map { |member| member.to_i }.to_set
end
end
end
end
Jump to Line
Something went wrong with that request. Please try again.