Class: Flipper::Gate
- Inherits:
-
Object
- Object
- Flipper::Gate
- Defined in:
- lib/flipper/gate.rb
Direct Known Subclasses
Flipper::Gates::Actor, Flipper::Gates::Boolean, Flipper::Gates::Group, Flipper::Gates::PercentageOfActors, Flipper::Gates::PercentageOfTime
Instance Method Summary collapse
- #data_type ⇒ Object
- #enabled?(value) ⇒ Boolean
-
#initialize(options = {}) ⇒ Gate
constructor
Public.
-
#inspect ⇒ Object
Public: Pretty string version for debugging.
-
#key ⇒ Object
Private: Name converted to value safe for adapter.
-
#name ⇒ Object
Public: The name of the gate.
-
#open?(thing, value, options = {}) ⇒ Boolean
Internal: Check if a gate is open for a thing.
-
#protects?(thing) ⇒ Boolean
Internal: Check if a gate is protects a thing.
-
#wrap(thing) ⇒ Object
Internal: Allows gate to wrap thing using one of the supported flipper types so adapters always get something that responds to value.
Constructor Details
#initialize(options = {}) ⇒ Gate
Public
4 5 |
# File 'lib/flipper/gate.rb', line 4 def initialize( = {}) end |
Instance Method Details
#data_type ⇒ Object
17 18 19 |
# File 'lib/flipper/gate.rb', line 17 def data_type raise 'Not implemented' end |
#enabled?(value) ⇒ Boolean
21 22 23 |
# File 'lib/flipper/gate.rb', line 21 def enabled?(value) raise 'Not implemented' end |
#inspect ⇒ Object
Public: Pretty string version for debugging.
46 47 48 49 50 51 52 53 |
# File 'lib/flipper/gate.rb', line 46 def inspect attributes = [ "name=#{name.inspect}", "key=#{key.inspect}", "data_type=#{data_type.inspect}", ] "#<#{self.class.name}:#{object_id} #{attributes.join(', ')}>" end |
#key ⇒ Object
Private: Name converted to value safe for adapter. Implemented in subclass.
13 14 15 |
# File 'lib/flipper/gate.rb', line 13 def key raise 'Not implemented' end |
#name ⇒ Object
Public: The name of the gate. Implemented in subclass.
8 9 10 |
# File 'lib/flipper/gate.rb', line 8 def name raise 'Not implemented' end |
#open?(thing, value, options = {}) ⇒ Boolean
Internal: Check if a gate is open for a thing. Implemented in subclass.
Returns true if gate open for thing, false if not.
28 29 30 |
# File 'lib/flipper/gate.rb', line 28 def open?(thing, value, = {}) false end |
#protects?(thing) ⇒ Boolean
Internal: Check if a gate is protects a thing. Implemented in subclass.
Returns true if gate protects thing, false if not.
35 36 37 |
# File 'lib/flipper/gate.rb', line 35 def protects?(thing) false end |
#wrap(thing) ⇒ Object
Internal: Allows gate to wrap thing using one of the supported flipper types so adapters always get something that responds to value.
41 42 43 |
# File 'lib/flipper/gate.rb', line 41 def wrap(thing) thing end |