Class: FeatureGate

Inherits:
Object
  • Object
show all
Defined in:
lib/feature_gate.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, value: false, rule_id: '', group_name: nil, id_type: '', evaluation_details: nil, target_app_ids: nil) ⇒ FeatureGate

Returns a new instance of FeatureGate.



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/feature_gate.rb', line 17

def initialize(
  name,
  value: false,
  rule_id: '',
  group_name: nil,
  id_type: '',
  evaluation_details: nil,
  target_app_ids: nil
)
  @name = name
  @value = value
  @rule_id = rule_id
  @group_name = group_name
  @id_type = id_type
  @evaluation_details = evaluation_details
  @target_app_ids = target_app_ids
end

Instance Attribute Details

#evaluation_detailsObject

Returns the value of attribute evaluation_details.



13
14
15
# File 'lib/feature_gate.rb', line 13

def evaluation_details
  @evaluation_details
end

#group_nameObject

Returns the value of attribute group_name.



9
10
11
# File 'lib/feature_gate.rb', line 9

def group_name
  @group_name
end

#id_typeObject

Returns the value of attribute id_type.



11
12
13
# File 'lib/feature_gate.rb', line 11

def id_type
  @id_type
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/feature_gate.rb', line 3

def name
  @name
end

#rule_idObject

Returns the value of attribute rule_id.



7
8
9
# File 'lib/feature_gate.rb', line 7

def rule_id
  @rule_id
end

#target_app_idsObject

Returns the value of attribute target_app_ids.



15
16
17
# File 'lib/feature_gate.rb', line 15

def target_app_ids
  @target_app_ids
end

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/feature_gate.rb', line 5

def value
  @value
end

Class Method Details

.from_config_result(res) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/feature_gate.rb', line 35

def self.from_config_result(res)
  new(
    res.name,
    value: res.gate_value,
    rule_id: res.rule_id,
    group_name: res.group_name,
    id_type: res.id_type,
    evaluation_details: res.evaluation_details,
    target_app_ids: res.target_app_ids
  )
end