lib/flipper/toggles/value.rb in flipper-0.3.0 vs lib/flipper/toggles/value.rb in flipper-0.4.0
- old
+ new
@@ -1,19 +1,25 @@
module Flipper
module Toggles
class Value < Toggle
def enable(thing)
super
- adapter.write key, thing.value
+ adapter.write adapter_key, thing.value
+ true
end
def disable(thing)
super
- adapter.delete key
+ adapter.delete adapter_key
+ true
end
def value
- adapter.read key
+ adapter.read adapter_key
+ end
+
+ def enabled?
+ !value.nil? && value.to_i > 0
end
end
end
end