Class: Statsig::APIRule
- Inherits:
-
Object
- Object
- Statsig::APIRule
- Defined in:
- lib/api_config.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
Returns the value of attribute conditions.
-
#config_delegate ⇒ Object
Returns the value of attribute config_delegate.
-
#group_name ⇒ Object
Returns the value of attribute group_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#id_type ⇒ Object
Returns the value of attribute id_type.
-
#is_experiment_group ⇒ Object
Returns the value of attribute is_experiment_group.
-
#name ⇒ Object
Returns the value of attribute name.
-
#pass_percentage ⇒ Object
Returns the value of attribute pass_percentage.
-
#return_value ⇒ Object
Returns the value of attribute return_value.
-
#salt ⇒ Object
Returns the value of attribute salt.
Class Method Summary collapse
Instance Attribute Details
#conditions ⇒ Object
Returns the value of attribute conditions.
51 52 53 |
# File 'lib/api_config.rb', line 51 def conditions @conditions end |
#config_delegate ⇒ Object
Returns the value of attribute config_delegate.
51 52 53 |
# File 'lib/api_config.rb', line 51 def config_delegate @config_delegate end |
#group_name ⇒ Object
Returns the value of attribute group_name.
51 52 53 |
# File 'lib/api_config.rb', line 51 def group_name @group_name end |
#id ⇒ Object
Returns the value of attribute id.
51 52 53 |
# File 'lib/api_config.rb', line 51 def id @id end |
#id_type ⇒ Object
Returns the value of attribute id_type.
51 52 53 |
# File 'lib/api_config.rb', line 51 def id_type @id_type end |
#is_experiment_group ⇒ Object
Returns the value of attribute is_experiment_group.
51 52 53 |
# File 'lib/api_config.rb', line 51 def is_experiment_group @is_experiment_group end |
#name ⇒ Object
Returns the value of attribute name.
51 52 53 |
# File 'lib/api_config.rb', line 51 def name @name end |
#pass_percentage ⇒ Object
Returns the value of attribute pass_percentage.
51 52 53 |
# File 'lib/api_config.rb', line 51 def pass_percentage @pass_percentage end |
#return_value ⇒ Object
Returns the value of attribute return_value.
51 52 53 |
# File 'lib/api_config.rb', line 51 def return_value @return_value end |
#salt ⇒ Object
Returns the value of attribute salt.
51 52 53 |
# File 'lib/api_config.rb', line 51 def salt @salt end |
Class Method Details
.from_json(json) ⇒ Object
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/api_config.rb', line 54 def self.from_json(json) new( name: json[:name], pass_percentage: json[:passPercentage], return_value: json[:returnValue] || {}, id: json[:id], salt: json[:salt], conditions: json[:conditions]&.map do |condition| APICondition.from_json(condition) end, id_type: json[:idType], group_name: json[:groupName], config_delegate: json[:configDelegate], is_experiment_group: json[:isExperimentGroup] ) end |