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: filters.rb
    path of file: ./repos/stackneveroverflow/vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.3/lib/active_support/core_ext/string
    
    the code of the file until where you have to start completion: class String
  # Returns the string, first removing all whitespace on both ends of
  # the string, and then changing remaining consecutive whit
    
  def truncate_words(words_count, options = {})
    sep = options[:separator] || /\s+/
    sep = Regexp.escape(sep.to_s) unless Regexp === sep
    if self =~ /\A((?>.+?#{sep}){#{words_count - 1}}.+?)#{sep}.*/m
      $1 + (options[:omission] || '...')
    else
      dup
    end