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: filename_fetch.rb
    path of file: ./repos/gitlabhq/lib/bulk_imports/file_downloads
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module BulkImports
  module FileDownloads
    module FilenameFetch
      REMOTE_FILENAME_PATTERN = %r{filename="(?<filename>[^"]+)"}
      FILENAME_SIZE_LIMIT = 255 # chars before the extension

      def raise_error(message)
        raise NotImplementedError
      end

      private

      # Fetch the remote filename information from the request content-disposition header
      # - Raises if the filename does not exist
      # - If the filename is longer then
    
      def remote_filename
        @remote_filename ||= begin
          pattern = BulkImports::FileDownloads::FilenameFetch::REMOTE_FILENAME_PATTERN
          name = response_headers['content-disposition'].to_s
            .match(pattern)                                # matches the filename pattern
            .then { |match| match&.named_captures || {} }  # ensures the match is a hash
            .fetch('filename')                             # fetches the 'filename' key or raise KeyError

          name = File.basename(name) # Ensures to remove path from the filename (../ for instance)
          ensure_filename_size(name) # Ensures the filename is within the FILENAME_SIZE_LIMIT
        end