You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: matches.rb
    path of file: ./repos/gitlabhq/lib/gitlab/ci/pipeline/expression/lexeme
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Gitlab
  module Ci
    module Pipeline
      module Expression
        module Lexeme
          class Matches < Lexeme::LogicalOperator
            PATTERN = /=~/

            def evaluate(variables = {})
              text = @left.e
    
            def evaluate(variables = {})
              text = @left.evaluate(variables)
              regexp = @right.evaluate(variables)

              return false unless regexp

              # All variables are evaluated as strings, even if they are regexp strings.
              # So, we need to convert them to regexp objects.
              regexp = Lexeme::Pattern.build_and_evaluate(regexp, variables)

              regexp.scan(text.to_s).present?
            end