Sha256: ee57ff9cf499882543db3a44a3cce100f43ee3a9a9bc6443c7ee7a636df047a0
Contents?: true
Size: 789 Bytes
Versions: 294
Compression:
Stored size: 789 Bytes
Contents
# frozen_string_literal: true module SplitIoClient # # class to implement the user defined matcher # class UserDefinedSegmentMatcher < Matcher MATCHER_TYPE = 'IN_SEGMENT' def initialize(segments_repository, segment_name, logger) super(logger) @segments_repository = segments_repository @segment_name = segment_name end # # evaluates if the key matches the matcher # # @param key [string] key value to be matched # # @return [boolean] evaluation of the key against the segment def match?(args) matches = @segments_repository.in_segment?(@segment_name, args[:value] || args[:matching_key]) @logger.log_if_debug("[InSegmentMatcher] #{@segment_name} is in segment -> #{matches}") matches end end end
Version data entries
294 entries across 294 versions & 1 rubygems