Sha256: 46c95ac2a57e5a43c45187b1236979161c2f9d1b2e59f50cc445cbc381b35a26

Contents?: true

Size: 560 Bytes

Versions: 56

Compression:

Stored size: 560 Bytes

Contents

# frozen_string_literal: true

module SplitIoClient
  class PartOfSetMatcher < SetMatcher
    MATCHER_TYPE = 'PART_OF_SET'

    attr_reader :attribute

    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
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
splitclient-rb-8.4.0-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.4.0 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.4.0.pre.rc1-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.4.0.pre.rc1 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.4.0.rc.1-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.4.0.rc.1 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.2.pre.rc2-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.2.pre.rc2 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.2.pre.rc1-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.2.pre.rc1 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.1-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.1 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.1.pre.rc1-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.1.pre.rc1 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.0-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.0 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.0.pre.rc3-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.0.pre.rc3 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.0.pre.rc2-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-8.3.0.pre.rc2 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb