18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/one_apm/support/rename_rules_engine/match_expression/base.rb', line 18
def type_match?(type, expression, sample)
case type
when 'equals'
sample.eql?(expression)
when 'endwith'
sample.end_with?(expression)
when 'startswith'
sample.start_with?(expression)
when 'contains'
sample.include?(expression)
when 'in'
expression = expression.split(',')
expression.include?(sample)
when 'existence', 'isnotempty'
!(sample.nil? || sample.to_s.empty?)
else
false
end
end
|