Class: SplitIoClient::PartOfSetMatcher
- Inherits:
-
SetMatcher
- Object
- SetMatcher
- SplitIoClient::PartOfSetMatcher
- Defined in:
- lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
Constant Summary collapse
- MATCHER_TYPE =
'PART_OF_SET'
Instance Attribute Summary collapse
-
#attribute ⇒ Object
readonly
Returns the value of attribute attribute.
Instance Method Summary collapse
-
#initialize(attribute, remote_array, logger) ⇒ PartOfSetMatcher
constructor
A new instance of PartOfSetMatcher.
- #match?(args) ⇒ Boolean
Methods inherited from SetMatcher
Constructor Details
#initialize(attribute, remote_array, logger) ⇒ PartOfSetMatcher
Returns a new instance of PartOfSetMatcher.
9 10 11 |
# File 'lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb', line 9 def initialize(attribute, remote_array, logger) super(attribute, remote_array, logger) end |
Instance Attribute Details
#attribute ⇒ Object (readonly)
Returns the value of attribute attribute.
7 8 9 |
# File 'lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb', line 7 def attribute @attribute end |
Instance Method Details
#match?(args) ⇒ Boolean
13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb', line 13 def match?(args) @local_set = local_set(args[:attributes], @attribute) if @local_set.empty? @logger.log_if_debug('[PartOfSetMatcher] Local Set is empty.') return false end matches = @local_set.subset? @remote_set @logger.log_if_debug("[PartOfSetMatcher] Local Set #{@local_set} is a subset of #{@remote_set} -> #{matches}") matches end |