Class: ConfigManager::Toggles::Set

Inherits:
Object
  • Object
show all
Defined in:
lib/config_manager/toggles/set.rb

Class Method Summary collapse

Class Method Details

.active?(toggle_def, challenge) ⇒ Boolean

Returns:



4
5
6
7
8
9
10
# File 'lib/config_manager/toggles/set.rb', line 4

def self.active?(toggle_def, challenge)
 	if toggle_def.acceptable_values.is_a?(Array)
   	return toggle_def.acceptable_values.include?(challenge)
 	else
   	return false
 	end
end

.from_json(json) ⇒ Object



16
17
18
# File 'lib/config_manager/toggles/set.rb', line 16

def self.from_json(json)
  json ? JSON.parse(json) : []
end

.to_json(values) ⇒ Object



12
13
14
# File 'lib/config_manager/toggles/set.rb', line 12

def self.to_json(values)
  values.to_json
end