Class: Hackle::TargetMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/hackle/internal/evaluation/match/target/target_matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(condition_matcher_factory:) ⇒ TargetMatcher

Returns a new instance of TargetMatcher.

Parameters:



7
8
9
10
# File 'lib/hackle/internal/evaluation/match/target/target_matcher.rb', line 7

def initialize(condition_matcher_factory:)
  # @type [ConditionMatcherFactory]
  @condition_matcher_factory = condition_matcher_factory
end

Instance Method Details

#matches(request, context, target) ⇒ boolean

Parameters:

Returns:

  • (boolean)


16
17
18
# File 'lib/hackle/internal/evaluation/match/target/target_matcher.rb', line 16

def matches(request, context, target)
  target.conditions.all? { |it| condition_matches(request, context, it) }
end