Class: DocumentExporter::Pdf::StudentMaterial

Inherits:
Base
  • Object
show all
Defined in:
lib/document_exporter/pdf/student_material.rb

Instance Method Summary collapse

Methods inherited from Base

#pdf_content, s3_folder

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
# File 'lib/document_exporter/pdf/student_material.rb', line 6

def export
  pdf = CombinePDF.new

  scope = @document.student_materials.where(id: included_materials)
  material_ids = ordered_materials scope.pluck(:id)
  pdf = combine_pdf_for pdf, material_ids
  pdf.to_pdf
end