Module: FeatureGuard

Defined in:
lib/feature_guard.rb,
lib/feature_guard/guard.rb,
lib/feature_guard/version.rb

Defined Under Namespace

Classes: Guard

Constant Summary collapse

VERSION =
"0.2.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.redisObject



26
27
28
# File 'lib/feature_guard.rb', line 26

def redis
  @redis ||= Redis.new
end

Class Method Details

.all_flagsObject



10
11
12
# File 'lib/feature_guard.rb', line 10

def all_flags
  redis.hgetall(flags_hkey).keys.inject({}) { |h, f| h[f] = enabled? f; h }
end

.all_rampsObject



14
15
16
# File 'lib/feature_guard.rb', line 14

def all_ramps
  redis.hgetall(ramps_hkey).keys.inject({}) { |h, f| h[f] = ramp_val f; h }
end

.flags_hkeyObject



18
19
20
# File 'lib/feature_guard.rb', line 18

def flags_hkey
  "featureguard_flags"
end

.ramps_hkeyObject



22
23
24
# File 'lib/feature_guard.rb', line 22

def ramps_hkey
  "featureguard_ramps"
end