Class: Hackle::FeatureFlagEvaluatorMatcher
- Inherits:
-
ExperimentEvaluatorMatcher
- Object
- ExperimentEvaluatorMatcher
- Hackle::FeatureFlagEvaluatorMatcher
- Defined in:
- lib/hackle/internal/evaluation/match/condition/experiment/experiment_evaluator_matcher.rb
Instance Method Summary collapse
- #evaluation_matches(evaluation, condition) ⇒ Object
- #experiment_or_nil(request, key) ⇒ Object
-
#initialize(evaluator:, value_operator_matcher:) ⇒ FeatureFlagEvaluatorMatcher
constructor
A new instance of FeatureFlagEvaluatorMatcher.
- #resolve_evaluation(_request, evaluation) ⇒ Object
Methods inherited from ExperimentEvaluatorMatcher
Constructor Details
#initialize(evaluator:, value_operator_matcher:) ⇒ FeatureFlagEvaluatorMatcher
Returns a new instance of FeatureFlagEvaluatorMatcher.
116 117 118 119 120 |
# File 'lib/hackle/internal/evaluation/match/condition/experiment/experiment_evaluator_matcher.rb', line 116 def initialize(evaluator:, value_operator_matcher:) super(evaluator: evaluator) # @type [ValueOperatorMatcher] @value_operator_matcher = value_operator_matcher end |
Instance Method Details
#evaluation_matches(evaluation, condition) ⇒ Object
130 131 132 133 |
# File 'lib/hackle/internal/evaluation/match/condition/experiment/experiment_evaluator_matcher.rb', line 130 def evaluation_matches(evaluation, condition) on = evaluation.variation_key != 'A' @value_operator_matcher.matches(on, condition.match) end |
#experiment_or_nil(request, key) ⇒ Object
122 123 124 |
# File 'lib/hackle/internal/evaluation/match/condition/experiment/experiment_evaluator_matcher.rb', line 122 def experiment_or_nil(request, key) request.workspace.get_feature_flag_or_nil(key) end |
#resolve_evaluation(_request, evaluation) ⇒ Object
126 127 128 |
# File 'lib/hackle/internal/evaluation/match/condition/experiment/experiment_evaluator_matcher.rb', line 126 def resolve_evaluation(_request, evaluation) evaluation end |