Class: LaunchDarkly::Impl::Model::FlagRule
- Inherits:
-
Object
- Object
- LaunchDarkly::Impl::Model::FlagRule
- Defined in:
- lib/ldclient-rb/impl/model/feature_flag.rb
Overview
Instance Attribute Summary collapse
- #clauses ⇒ Array<LaunchDarkly::Impl::Model::Clause> readonly
- #data ⇒ Hash readonly
- #match_results ⇒ LaunchDarkly::Impl::Model::EvalResultFactoryMultiVariations readonly
- #variation_or_rollout ⇒ LaunchDarkly::Impl::Model::VariationOrRollout readonly
Instance Method Summary collapse
-
#initialize(data, rule_index, flag, errors_out = nil) ⇒ FlagRule
constructor
A new instance of FlagRule.
Constructor Details
#initialize(data, rule_index, flag, errors_out = nil) ⇒ FlagRule
Returns a new instance of FlagRule.
163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 163 def initialize(data, rule_index, flag, errors_out = nil) @data = data @clauses = (data[:clauses] || []).map do |clause_data| Clause.new(clause_data, errors_out) end @variation_or_rollout = VariationOrRollout.new(data[:variation], data[:rollout], flag, errors_out, 'rule') rule_id = data[:id] match_reason = EvaluationReason::rule_match(rule_index, rule_id) match_reason_in_experiment = EvaluationReason::rule_match(rule_index, rule_id, true) @match_results = Preprocessor.precompute_multi_variation_results(flag, match_reason, match_reason_in_experiment) end |
Instance Attribute Details
#clauses ⇒ Array<LaunchDarkly::Impl::Model::Clause> (readonly)
178 179 180 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 178 def clauses @clauses end |
#data ⇒ Hash (readonly)
176 177 178 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 176 def data @data end |
#match_results ⇒ LaunchDarkly::Impl::Model::EvalResultFactoryMultiVariations (readonly)
180 181 182 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 180 def match_results @match_results end |
#variation_or_rollout ⇒ LaunchDarkly::Impl::Model::VariationOrRollout (readonly)
182 183 184 |
# File 'lib/ldclient-rb/impl/model/feature_flag.rb', line 182 def variation_or_rollout @variation_or_rollout end |