Sha256: 099eddfba6f5478fa0198cba794fab92afc50e82a98406d751be9707344753db

Contents?: true

Size: 666 Bytes

Versions: 238

Compression:

Stored size: 666 Bytes

Contents

# frozen_string_literal: true

module SplitIoClient
  class PartOfSetMatcher < SetMatcher
    MATCHER_TYPE = 'PART_OF_SET'

    attr_reader :attribute

    def initialize(attribute, remote_array, logger)
      super(attribute, remote_array, logger)
    end

    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

238 entries across 238 versions & 1 rubygems

Version Path
splitclient-rb-7.3.3.pre.rc8-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc8 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc7-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc7 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc6-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc6 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc5-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc5 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc4-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc4 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc3-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc3 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc2-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc2 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc1-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.3.pre.rc1 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.2-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.2 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.2.pre.rc5-java lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb
splitclient-rb-7.3.2.pre.rc5 lib/splitclient-rb/engine/matchers/part_of_set_matcher.rb