Sha256: c9db754c8c86e15d60a2e1fe4ac7211c1c86fee456a65840aee8769f929d0f37

Contents?: true

Size: 558 Bytes

Versions: 294

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

require 'set'

module SplitIoClient
  class SetMatcher
    def string_type?
      false
    end

    protected

    def initialize(attribute, remote_array, logger)
      @attribute = attribute
      @remote_set = remote_array.to_set
      @logger = logger
    end

    def local_set(data, attribute)
      data = data.fetch(attribute) { |a| data[a.to_s] || data[a.to_sym] }
      # Allow user to pass individual elements as well
      local_array = data.is_a?(Array) ? data : [data]

      local_array.to_set
    end
  end
end

Version data entries

294 entries across 294 versions & 1 rubygems

Version Path
splitclient-rb-8.3.0.pre.rc1-java lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.3.0.pre.rc1 lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.2.0-java lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.2.0 lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.3.pre.rc4-java lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.3.pre.rc4 lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.3.pre.rc3-java lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.3.pre.rc3 lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.3.pre.rc2-java lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.3.pre.rc2 lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.3.pre.rc1-java lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.3.pre.rc1 lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.2-java lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.2 lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.2.pre.rc1-java lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.2.pre.rc1 lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.1-java lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.1 lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.1.pre.rc3-java lib/splitclient-rb/engine/matchers/set_matcher.rb
splitclient-rb-8.1.1.pre.rc3 lib/splitclient-rb/engine/matchers/set_matcher.rb