Class: FeatureGate

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
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.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/feature_gate.rb', line 40

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.



24
25
26
# File 'lib/feature_gate.rb', line 24

def evaluation_details
  @evaluation_details
end

#group_nameObject

Returns the value of attribute group_name.



18
19
20
# File 'lib/feature_gate.rb', line 18

def group_name
  @group_name
end

#id_typeObject

Returns the value of attribute id_type.



21
22
23
# File 'lib/feature_gate.rb', line 21

def id_type
  @id_type
end

#nameObject

Returns the value of attribute name.



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

def name
  @name
end

#rule_idObject

Returns the value of attribute rule_id.



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

def rule_id
  @rule_id
end

#target_app_idsObject

Returns the value of attribute target_app_ids.



27
28
29
# File 'lib/feature_gate.rb', line 27

def target_app_ids
  @target_app_ids
end

#valueObject

Returns the value of attribute value.



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

def value
  @value
end

Class Method Details

.from_config_result(res) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/feature_gate.rb', line 59

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