Class: DocumentExporter::PDF::Base

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

Direct Known Subclasses

Document, Material, StudentMaterial, TeacherMaterial

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#included_materials, #initialize, #ordered_materials, pdf_key

Constructor Details

This class inherits a constructor from DocumentExporter::Base

Class Method Details

.s3_folderObject



6
7
8
# File 'lib/document_exporter/pdf/base.rb', line 6

def self.s3_folder
  @s3_folder ||= ENV.fetch('SWAP_DOCS', 'documents')
end

Instance Method Details

#exportObject



10
11
12
# File 'lib/document_exporter/pdf/base.rb', line 10

def export
  WickedPdf.new.pdf_from_string(pdf_content, pdf_params)
end

#pdf_contentObject



14
15
16
17
# File 'lib/document_exporter/pdf/base.rb', line 14

def pdf_content
  content = render_template template_path('show'), layout: 'lcms/engine/cg_pdf'
  content.gsub(/(___+)/, '<span class="o-od-compress-underscore">\1</span>')
end