def download_to(dir = Dir.pwd, opts = { force_download: false })
      delete_files!(dir) if opts[:force_download]

      return if file_exist?(dir)

      image = Tools.get(uri)

      append_file_data(dir, image)
      append_file_ext(dir)
    rescue StandardError => error
      logger.error({
        msg: 'Failed to download page',
        page: self,
        uri: uri,
        error: error,
        error_msg: error.message,
        backtrace: error.backtrace
      }.to_s)
    end
def download_to(dir = Dir.pwd, opts = { force_download: false })
      delete_files!(dir) if opts[:force_download]

      return if file_exist?(dir)

      image = Tools.get(uri)

      append_file_data(dir, image)
      append_file_ext(dir)
    rescue StandardError => error
      logger.error({
        msg: 'Failed to download page',
        page: self,
        uri: uri,
        error: error,
        error_msg: error.message,
        backtrace: error.backtrace
      }.to_s)
    end
rubocop:disable Metrics/MethodLength