class Flipper::Gate

Public Class Methods

new(options = {}) click to toggle source

Public

# File lib/flipper/gate.rb, line 4
def initialize(options = {})
end

Public Instance Methods

data_type() click to toggle source
# File lib/flipper/gate.rb, line 17
def data_type
  raise 'Not implemented'
end
enabled?(_value) click to toggle source
# File lib/flipper/gate.rb, line 21
def enabled?(_value)
  raise 'Not implemented'
end
inspect() click to toggle source

Public: Pretty string version for debugging.

# 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() click to toggle source

Private: Name converted to value safe for adapter. Implemented in subclass.

# File lib/flipper/gate.rb, line 13
def key
  raise 'Not implemented'
end
name() click to toggle source

Public: The name of the gate. Implemented in subclass.

# File lib/flipper/gate.rb, line 8
def name
  raise 'Not implemented'
end
open?(_thing, _value, _options = {}) click to toggle source

Internal: Check if a gate is open for a thing. Implemented in subclass.

Returns true if gate open for thing, false if not.

# File lib/flipper/gate.rb, line 28
def open?(_thing, _value, _options = {})
  false
end
protects?(_thing) click to toggle source

Internal: Check if a gate is protects a thing. Implemented in subclass.

Returns true if gate protects thing, false if not.

# File lib/flipper/gate.rb, line 35
def protects?(_thing)
  false
end
wrap(thing) click to toggle source

Internal: Allows gate to wrap thing using one of the supported flipper types so adapters always get something that responds to value.

# File lib/flipper/gate.rb, line 41
def wrap(thing)
  thing
end