Class: Clamsy::TemplateOpenDoc

Inherits:
Object
  • Object
show all
Includes:
FileSystemSupport
Defined in:
lib/clamsy/template_open_doc.rb

Instance Method Summary collapse

Methods included from FileSystemSupport

#file_must_exist!, #tmp_file, #trash_tmp_files

Constructor Details

#initialize(template_doc) ⇒ TemplateOpenDoc

Returns a new instance of TemplateOpenDoc.



17
18
19
20
# File 'lib/clamsy/template_open_doc.rb', line 17

def initialize(template_doc)
  file_must_exist!(@template_doc = template_doc)
  initialize_template_workers
end

Instance Method Details

#render(context) ⇒ Object



22
23
24
25
# File 'lib/clamsy/template_open_doc.rb', line 22

def render(context)
  File.copy(@template_doc, (file = tmp_doc(context)).path)
  OpenDoc.new(file, @template_workers, context).transform
end