Sha256: b8f6db06751e6f804caa0466315e1276e147c483f44f297ce7ea02ec0ea6806a
Contents?: true
Size: 760 Bytes
Versions: 28
Compression:
Stored size: 760 Bytes
Contents
# frozen_string_literal: true module SplitIoClient class DependencyMatcher MATCHER_TYPE = 'IN_SPLIT_TREATMENT' def initialize(split, treatments) @split = split @treatments = treatments end def match?(args) keys = { matching_key: args[:matching_key], bucketing_key: args[:bucketing_key] } evaluate = args[:evaluator].call(keys, @split, args[:attributes]) matches = @treatments.include?(evaluate[:treatment]) SplitLogger.log_if_debug("[dependencyMatcher] Parent split #{@split} evaluated to #{evaluate[:treatment]} \ with label #{evaluate[:label]}. #{@split} evaluated treatment is part of [#{@treatments}] ? #{matches}.") matches end def string_type? false end end end
Version data entries
28 entries across 28 versions & 1 rubygems