Class: Flipper::Gates::Actor

Inherits:
Flipper::Gate show all
Defined in:
lib/flipper/gates/actor.rb

Constant Summary collapse

Key =
:actors

Constants inherited from Flipper::Gate

Flipper::Gate::Separator

Instance Attribute Summary

Attributes inherited from Flipper::Gate

#feature

Instance Method Summary collapse

Methods inherited from Flipper::Gate

#disable, #enable, #initialize, #key, #key_prefix, #match?, #toggle

Constructor Details

This class inherits a constructor from Flipper::Gate

Instance Method Details

#identifiersObject



20
21
22
# File 'lib/flipper/gates/actor.rb', line 20

def identifiers
  toggle.value
end

#open?(actor) ⇒ Boolean

Returns:



14
15
16
17
18
# File 'lib/flipper/gates/actor.rb', line 14

def open?(actor)
  if actor && actor.respond_to?(:identifier)
    identifiers.include?(actor.identifier)
  end
end

#protects?(thing) ⇒ Boolean

Returns:



24
25
26
# File 'lib/flipper/gates/actor.rb', line 24

def protects?(thing)
  thing.is_a?(Flipper::Types::Actor)
end

#toggle_classObject



10
11
12
# File 'lib/flipper/gates/actor.rb', line 10

def toggle_class
  Toggles::Set
end

#type_keyObject



6
7
8
# File 'lib/flipper/gates/actor.rb', line 6

def type_key
  Key
end