Class: Docxer::ContentTypes
- Inherits:
-
Object
- Object
- Docxer::ContentTypes
- Defined in:
- lib/docxer/content_types.rb,
lib/docxer/content_types/default.rb,
lib/docxer/content_types/override.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#content_types ⇒ Object
Returns the value of attribute content_types.
Instance Method Summary collapse
- #add(type, attr, content) ⇒ Object
-
#initialize ⇒ ContentTypes
constructor
A new instance of ContentTypes.
- #render(zip) ⇒ Object
Constructor Details
#initialize ⇒ ContentTypes
Returns a new instance of ContentTypes.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/docxer/content_types.rb', line 9 def initialize @content_types = [] add(:default, "rels", "application/vnd.openxmlformats-package.relationships+xml") add(:default, "xml", "application/xml") add(:default, "png", "image/png") add(:override, "/word/document.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml") add(:override, "/word/styles.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml") add(:override, "/word/stylesWithEffects.xml", "application/vnd.ms-word.stylesWithEffects+xml") add(:override, "/word/settings.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml") add(:override, "/word/webSettings.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.webSettings+xml") add(:override, "/word/fontTable.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml") add(:override, "/word/theme/theme1.xml", "application/vnd.openxmlformats-officedocument.theme+xml") add(:override, "/docProps/core.xml", "application/vnd.openxmlformats-package.core-properties+xml") add(:override, "/docProps/app.xml", "application/vnd.openxmlformats-officedocument.extended-properties+xml") add(:override, "/word/numbering.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml") add(:override, "/word/footnotes.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml") add(:override, "/word/endnotes.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml") add(:override, "/word/footer1.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml") add(:override, "/word/header1.xml", "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml") end |
Instance Attribute Details
#content_types ⇒ Object
Returns the value of attribute content_types.
7 8 9 |
# File 'lib/docxer/content_types.rb', line 7 def content_types @content_types end |
Instance Method Details
#add(type, attr, content) ⇒ Object
30 31 32 33 34 |
# File 'lib/docxer/content_types.rb', line 30 def add(type, attr, content) content_type = create_content_type(type, attr, content) @content_types << content_type if content_type content_type end |