Sha256: 6df6c4d573a60d064aa6826ceeba4de5be135ccb718789d24798799dc918e034

Contents?: true

Size: 410 Bytes

Versions: 2

Compression:

Stored size: 410 Bytes

Contents

module SplitIoClient
  class EndsWithMatcher
    def self.matcher_type
      'ENDS_WITH'.freeze
    end

    def initialize(attribute, suffix_list)
      @attribute = attribute
      @suffix_list = suffix_list
    end

    def match?(value, _matching_key, _bucketing_key, _evaluator)
      return false if @suffix_list.empty?

      @suffix_list.any? { |suffix| value.to_s.end_with? suffix }
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
splitclient-rb-4.3.0.canary.2 lib/splitclient-rb/engine/matchers/ends_with_matcher.rb
splitclient-rb-4.3.0.canary.1 lib/splitclient-rb/engine/matchers/ends_with_matcher.rb