# encoding: utf-8 module OneApm module Support class RenameRulesEngine module MatchExpression class Base attr_accessor :is_not, :match_value, :operate, :state def initialize(expression) @is_not = expression[:is_not] @match_value = expression[:match_value] @operate = expression[:operate] @state = expression[:state]==0 ? true : false end 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 def match?(request) false end end end end end end