Sha256: dd04aca23e5b5b3bac0a95eee6890452ffda7ef4883dbed156aaf55302cad3af

Contents?: true

Size: 635 Bytes

Versions: 238

Compression:

Stored size: 635 Bytes

Contents

# frozen_string_literal: true

module SplitIoClient
  class ContainsAllMatcher < SetMatcher
    MATCHER_TYPE = 'CONTAINS_ALL'

    attr_reader :attribute

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

    def match?(args)
      if @remote_set.empty?
        @logger.log_if_debug('[ContainsAllMatcher] Remote Set Empty')
        return false
      end

      matches = @remote_set.subset? local_set(args[:attributes], @attribute)
      @logger.log_if_debug("[ContainsAllMatcher] Remote Set #{@remote_set} contains #{@attribute} -> #{matches}")
      matches
    end
  end
end

Version data entries

238 entries across 238 versions & 1 rubygems

Version Path
splitclient-rb-8.0.0.pre.rc1-java lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-8.0.0.pre.rc1 lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.5.pre.rc5-java lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.5.pre.rc5 lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.5.pre.rc4-java lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.5.pre.rc4 lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.5.pre.rc3-java lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.5.pre.rc3 lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.5.pre.rc2-java lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.5.pre.rc2 lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.5.pre.rc1-java lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.5.pre.rc1 lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.4-java lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.4 lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.4.pre.rc2-java lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.4.pre.rc2 lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.4.pre.rc1-java lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.4.pre.rc1 lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.3-java lib/splitclient-rb/engine/matchers/contains_all_matcher.rb
splitclient-rb-7.3.3 lib/splitclient-rb/engine/matchers/contains_all_matcher.rb