Class: CircuitB::Storage::Redis

Inherits:
Base
  • Object
show all
Defined in:
lib/circuit_b/storage/redis.rb

Instance Method Summary collapse

Constructor Details

#initializeRedis

Returns a new instance of Redis.



8
9
10
# File 'lib/circuit_b/storage/redis.rb', line 8

def initialize
  @redis = ::Redis.new
end

Instance Method Details

#get(fuse_name, field) ⇒ Object



16
17
18
# File 'lib/circuit_b/storage/redis.rb', line 16

def get(fuse_name, field)
  @redis[key(fuse_name, field)]
end

#inc(fuse_name, field) ⇒ Object



20
21
22
# File 'lib/circuit_b/storage/redis.rb', line 20

def inc(fuse_name, field)
  return @redis.incr(key(fuse_name, field))
end

#put(fuse_name, field, value) ⇒ Object



12
13
14
# File 'lib/circuit_b/storage/redis.rb', line 12

def put(fuse_name, field, value)
  @redis[key(fuse_name, field)] = value
end