Class: Hackle::ValueOperatorMatcher
- Inherits:
-
Object
- Object
- Hackle::ValueOperatorMatcher
- Defined in:
- lib/hackle/internal/evaluation/match/value/value_operator_matcher.rb
Instance Method Summary collapse
-
#initialize(value_matcher_factory:, operator_matcher_factory:) ⇒ ValueOperatorMatcher
constructor
A new instance of ValueOperatorMatcher.
- #matches(value, match) ⇒ boolean
Constructor Details
#initialize(value_matcher_factory:, operator_matcher_factory:) ⇒ ValueOperatorMatcher
Returns a new instance of ValueOperatorMatcher.
9 10 11 12 13 14 |
# File 'lib/hackle/internal/evaluation/match/value/value_operator_matcher.rb', line 9 def initialize(value_matcher_factory:, operator_matcher_factory:) # @type [ValueMatcherFactory] @value_matcher_factory = value_matcher_factory # @type [OperatorMatcherFactory] @operator_matcher_factory = operator_matcher_factory end |
Instance Method Details
#matches(value, match) ⇒ boolean
19 20 21 22 23 24 25 |
# File 'lib/hackle/internal/evaluation/match/value/value_operator_matcher.rb', line 19 def matches(value, match) value_matcher = @value_matcher_factory.get(match.value_type) operator_matcher = @operator_matcher_factory.get(match.operator) matches = internal_matches(value, match, value_matcher, operator_matcher) TargetMatchType.matches(match.type, matches) end |