Class: Flipper::Gates::Group
Constant Summary
collapse
- Key =
:groups
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
#group_names ⇒ Object
19
20
21
|
# File 'lib/flipper/gates/group.rb', line 19
def group_names
toggle.value
end
|
#groups ⇒ Object
23
24
25
|
# File 'lib/flipper/gates/group.rb', line 23
def groups
group_names.map { |name| Flipper.group(name) }.compact
end
|
#open?(actor) ⇒ Boolean
14
15
16
17
|
# File 'lib/flipper/gates/group.rb', line 14
def open?(actor)
return if actor.nil?
groups.any? { |group| group.match?(actor) }
end
|
#protects?(thing) ⇒ Boolean
27
28
29
|
# File 'lib/flipper/gates/group.rb', line 27
def protects?(thing)
thing.is_a?(Flipper::Types::Group)
end
|
#toggle_class ⇒ Object
10
11
12
|
# File 'lib/flipper/gates/group.rb', line 10
def toggle_class
Toggles::Set
end
|
#type_key ⇒ Object
6
7
8
|
# File 'lib/flipper/gates/group.rb', line 6
def type_key
Key
end
|