Sha256: d992b9bb8ded15b89d030b6e06cc32dd887a1d6021667c3de31da5848c5857bb
Contents?: true
Size: 1.29 KB
Versions: 26
Compression:
Stored size: 1.29 KB
Contents
require 'nokogiri' require 'caracal/renderers/xml_renderer' module Caracal module Renderers class CoreRenderer < XmlRenderer #------------------------------------------------------------- # Public Methods #------------------------------------------------------------- # This method produces the xml required for the `docProps/core.xml` # sub-document. # def to_xml builder = ::Nokogiri::XML::Builder.with(declaration_xml) do |xml| xml.send 'cp:coreProperties', root_options do xml['dc'].title document.name end end builder.to_xml(save_options) end #------------------------------------------------------------- # Private Methods #------------------------------------------------------------- private def root_options { 'xmlns:cp' => 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties', 'xmlns:dc' => 'http://purl.org/dc/elements/1.1/', 'xmlns:dcterms' => 'http://purl.org/dc/terms/', 'xmlns:dcmitype' => 'http://purl.org/dc/dcmitype/', 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance' } end end end end
Version data entries
26 entries across 26 versions & 1 rubygems