Class: DocumentExporter::Gdoc::Material

Inherits:
Base
  • Object
show all
Defined in:
lib/document_exporter/gdoc/material.rb

Constant Summary

Constants inherited from Base

Base::GOOGLE_API_CLIENT_UPLOAD_RETRIES, Base::GOOGLE_API_CLIENT_UPLOAD_TIMEOUT, Base::GOOGLE_API_UPLOAD_OPTIONS, Base::VERSION_RE

Instance Attribute Summary

Attributes inherited from Base

#document, #options

Instance Method Summary collapse

Methods inherited from Base

#create_gdoc_folders, #export_to, gdoc_key, #url, url_for

Methods inherited from Base

#included_materials, #initialize, #ordered_materials, pdf_key

Constructor Details

This class inherits a constructor from DocumentExporter::Base

Instance Method Details

#exportObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/document_exporter/gdoc/material.rb', line 6

def export
  @options[:subfolders] = [DocumentExporter::Gdoc::StudentMaterial::FOLDER_NAME] if document.student_material?
  @options[:subfolders] = [DocumentExporter::Gdoc::TeacherMaterial::FOLDER_NAME] if document.teacher_material?
  unless @options.key?(:subfolders)
    Rails.logger.warn "Material belongs neither to teachers nor to students: #{document.id}"
    @options[:subfolders] = ['Materials']
  end

  handle_vertical_text if document.vertical_text?

  super
end