Class: Doct::Formats::OpenFormat

Inherits:
Base
  • Object
show all
Defined in:
lib/doct/formats/open_format.rb

Direct Known Subclasses

Docx, Odt

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Doct::Formats::Base

Instance Method Details

#content_entriesObject



27
28
29
# File 'lib/doct/formats/open_format.rb', line 27

def content_entries
  nil
end

#content_entry?(entry) ⇒ Boolean

Returns:

  • (Boolean)


31
32
33
# File 'lib/doct/formats/open_format.rb', line 31

def content_entry?(entry)
  false
end

#placeholdersObject



19
20
21
22
23
24
25
# File 'lib/doct/formats/open_format.rb', line 19

def placeholders
  placeholders = []
  each_entry do |entry, file|
    placeholders += entry_placeholders(entry, file) if _content_entry?(entry)
  end
  placeholders
end

#render(params) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/doct/formats/open_format.rb', line 9

def render(params)
  Zip::ZipOutputStream.write_buffer do |output|
    each_entry do |entry, file|
      file = entry_render(entry, file, params) if _content_entry?(entry)
      output.put_next_entry entry
      output.write file
    end
  end.string
end