Class: Hackle::ExperimentConditionMatcher
- Inherits:
-
Object
- Object
- Hackle::ExperimentConditionMatcher
- Includes:
- ConditionMatcher
- Defined in:
- lib/hackle/internal/evaluation/match/condition/experiment/experiment_condition_matcher.rb
Instance Method Summary collapse
-
#initialize(ab_test_matcher:, feature_flag_matcher:) ⇒ ExperimentConditionMatcher
constructor
A new instance of ExperimentConditionMatcher.
- #matches(request, context, condition) ⇒ Object
Constructor Details
#initialize(ab_test_matcher:, feature_flag_matcher:) ⇒ ExperimentConditionMatcher
Returns a new instance of ExperimentConditionMatcher.
11 12 13 14 15 16 |
# File 'lib/hackle/internal/evaluation/match/condition/experiment/experiment_condition_matcher.rb', line 11 def initialize(ab_test_matcher:, feature_flag_matcher:) # @type [ExperimentEvaluatorMatcher] @ab_test_matcher = ab_test_matcher # @type [ExperimentEvaluatorMatcher] @feature_flag_matcher = feature_flag_matcher end |
Instance Method Details
#matches(request, context, condition) ⇒ Object
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/hackle/internal/evaluation/match/condition/experiment/experiment_condition_matcher.rb', line 18 def matches(request, context, condition) case condition.key.type when TargetKeyType::AB_TEST @ab_test_matcher.matches(request, context, condition) when TargetKeyType::FEATURE_FLAG @feature_flag_matcher.matches(request, context, condition) else raise ArgumentError, "unsupported TargetKeyType [#{condition.key.type}]" end end |