Sha256: b531731f22ce187754da2e245094e5f84b1ce2c98d8c18561b06f12da8fb3ad1
Contents?: true
Size: 853 Bytes
Versions: 28
Compression:
Stored size: 853 Bytes
Contents
# frozen_string_literal: true require 'set' module SplitIoClient module Cache module Filter class FlagSetsFilter def initialize(flag_sets = []) @flag_sets = Set.new(flag_sets) @should_filter = @flag_sets.any? end def should_filter? @should_filter end def flag_set_exist?(flag_set) return true unless @should_filter if not flag_set.is_a?(String) or flag_set.empty? return false end @flag_sets.intersection([flag_set]).any? end def intersect?(flag_sets) return true unless @should_filter if not flag_sets.is_a?(Array) or flag_sets.empty? return false end @flag_sets.intersection(Set.new(flag_sets)).any? end end end end end
Version data entries
28 entries across 28 versions & 1 rubygems