Class: Flipper::Gates::Boolean
- Inherits:
-
Flipper::Gate
- Object
- Flipper::Gate
- Flipper::Gates::Boolean
- Defined in:
- lib/flipper/gates/boolean.rb
Constant Summary
Constants inherited from Flipper::Gate
Flipper::Gate::InstrumentationName
Instance Attribute Summary
Attributes inherited from Flipper::Gate
Instance Method Summary collapse
- #description ⇒ Object
-
#key ⇒ Object
Internal: The piece of the adapter key that is unique to the gate class.
-
#name ⇒ Object
Internal: The name of the gate.
-
#open?(thing) ⇒ Boolean
Internal: Checks if the gate is open for a thing.
- #protects?(thing) ⇒ Boolean
-
#toggle_class ⇒ Object
Internal: The toggle class used to enable/disable the gate for a thing.
Methods inherited from Flipper::Gate
#adapter_key, #disable, #enable, #enabled?, #initialize, #inspect, #instrument, #toggle
Constructor Details
This class inherits a constructor from Flipper::Gate
Instance Method Details
#description ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/flipper/gates/boolean.rb', line 30 def description if enabled? 'Enabled' else 'Disabled' end end |
#key ⇒ Object
Internal: The piece of the adapter key that is unique to the gate class.
10 11 12 |
# File 'lib/flipper/gates/boolean.rb', line 10 def key :boolean end |
#name ⇒ Object
Internal: The name of the gate. Used for instrumentation, etc.
5 6 7 |
# File 'lib/flipper/gates/boolean.rb', line 5 def name :boolean end |
#open?(thing) ⇒ Boolean
Internal: Checks if the gate is open for a thing.
Returns true if gate open for thing, false if not.
22 23 24 |
# File 'lib/flipper/gates/boolean.rb', line 22 def open?(thing) instrument(:open?, thing) { |payload| toggle.value } end |