Class: Togls::Rules::Boolean
- Inherits:
-
Togls::Rule
- Object
- Togls::Rule
- Togls::Rules::Boolean
- Defined in:
- lib/togls/rules/boolean.rb
Overview
Boolean Rule
The Boolean Rule is a provided Rule that expects to be given a boolean as it’s initialization data and when evaluated determines the toggle state based on the initialization value. Example:
always_on = Togls::Rules::Boolean.new(true) Togls.features do
feature(:foo).on(always_on)
end
if Togls.feature(:foo).on?
...
end
Instance Attribute Summary
Attributes inherited from Togls::Rule
Instance Method Summary collapse
Methods inherited from Togls::Rule
Constructor Details
This class inherits a constructor from Togls::Rule
Instance Method Details
#run(_key, _target = nil) ⇒ Object
18 19 20 |
# File 'lib/togls/rules/boolean.rb', line 18 def run(_key, _target = nil) @data end |