class DocumentExporter::Docx

Public Class Methods

new(document) click to toggle source
# File lib/document_exporter/docx.rb, line 7
def initialize(document)
  @document = document
end

Public Instance Methods

export() click to toggle source
# File lib/document_exporter/docx.rb, line 11
def export
  PandocRuby.convert content, from: :html, to: :docx
end

Private Instance Methods

content() click to toggle source
# File lib/document_exporter/docx.rb, line 17
def content
  @content ||= ApplicationController.render(
    layout: 'ld_docx',
    locals: { :@document => @document },
    template: 'documents/docx/export'
  )
end