Class: Flipper::Gates::Boolean
Constant Summary
collapse
- Key =
:boolean
Flipper::Gate::Separator
Instance Attribute Summary
#feature
Instance Method Summary
collapse
#disable, #enable, #initialize, #key, #key_prefix, #match?, #toggle
Constructor Details
This class inherits a constructor from Flipper::Gate
Instance Method Details
#open?(actor) ⇒ Boolean
14
15
16
17
18
19
20
21
22
|
# File 'lib/flipper/gates/boolean.rb', line 14
def open?(actor)
value = toggle.value
if value.nil?
false
else
throw :short_circuit, !!value
end
end
|
#protects?(thing) ⇒ Boolean
24
25
26
|
# File 'lib/flipper/gates/boolean.rb', line 24
def protects?(thing)
thing.is_a?(Flipper::Types::Boolean)
end
|
#toggle_class ⇒ Object
10
11
12
|
# File 'lib/flipper/gates/boolean.rb', line 10
def toggle_class
Toggles::Boolean
end
|
#type_key ⇒ Object
6
7
8
|
# File 'lib/flipper/gates/boolean.rb', line 6
def type_key
Key
end
|