Sha256: cd7bc858439f97dd113f5c2ed7bb05fb4f7a9134a863c6be7eb2013eb7335e0d
Contents?: true
Size: 569 Bytes
Versions: 62
Compression:
Stored size: 569 Bytes
Contents
module SplitIoClient class StartsWithMatcher MATCHER_TYPE = 'STARTS_WITH'.freeze attr_reader :attribute def initialize(attribute, prefix_list) @attribute = attribute @prefix_list = prefix_list end def match?(args) value = args[:value] || args[:attributes].fetch(@attribute) do |a| args[:attributes][a.to_s] || args[:attributes][a.to_sym] end return false if @prefix_list.empty? @prefix_list.any? { |prefix| value.to_s.start_with? prefix } end def string_type? true end end end
Version data entries
62 entries across 62 versions & 1 rubygems