Class: Hackle::FeatureFlagEvaluatorMatcher

Inherits:
ExperimentEvaluatorMatcher show all
Defined in:
lib/hackle/internal/evaluation/match/condition/experiment/experiment_evaluator_matcher.rb

Instance Method Summary collapse

Methods inherited from ExperimentEvaluatorMatcher

#matches

Constructor Details

#initialize(evaluator:, value_operator_matcher:) ⇒ FeatureFlagEvaluatorMatcher

Returns a new instance of FeatureFlagEvaluatorMatcher.

Parameters:



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