Class: Goldendocx::Parts::Core
- Inherits:
-
Object
- Object
- Goldendocx::Parts::Core
- Includes:
- Document
- Defined in:
- lib/goldendocx/parts/core.rb
Constant Summary collapse
- TYPE =
'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties'- XML_PATH =
'docProps/core.xml'- NAMESPACE =
'http://schemas.openxmlformats.org/officeDocument/2006/extended-properties'- CONTENT_TYPE =
'application/vnd.openxmlformats-package.core-properties+xml'
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Core
constructor
A new instance of Core.
- #write_to(zos) ⇒ Object
Methods included from Document
Methods included from Element
#build_element, #namespace, #tag, #tag_name, #to_element, #to_xml
Methods included from HasChildren
#children, #read_child, #read_children
Methods included from HasAttributes
#assign_attributes, #attributes, #read_attributes
Constructor Details
#initialize ⇒ Core
Returns a new instance of Core.
35 36 37 38 |
# File 'lib/goldendocx/parts/core.rb', line 35 def initialize build_creator(name: "Goldendocx_#{Goldendocx::VERSION}") build_created_at(timestamp: Time.now) end |
Class Method Details
.read_from(xml_node) ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/goldendocx/parts/core.rb', line 25 def read_from(xml_node) core = super(xml_node) revision = (core.revision || core.build_revision) revision.value = revision.value.to_i + 1 core.build_updater(name: "Goldendocx_#{Goldendocx::VERSION}") core.build_updated_at(timestamp: Time.now) core end |
Instance Method Details
#write_to(zos) ⇒ Object
40 41 42 43 |
# File 'lib/goldendocx/parts/core.rb', line 40 def write_to(zos) zos.put_next_entry XML_PATH zos.write to_document_xml end |