Sha256: 1487f1ab2052e035b0fd1fb63a018c27c461d3cf08d612e63454c5de319cff77

Contents?: true

Size: 747 Bytes

Versions: 6

Compression:

Stored size: 747 Bytes

Contents

module Axlsx

  class Core
    attr_accessor :creator
    def initialize(options={})
      @creator = options[:creator] || 'axlsx'
      
    end
    def to_xml()
      builder = Nokogiri::XML::Builder.new(:encoding => ENCODING) do |xml|
        xml.send('cp:coreProperties', 
                 :"xmlns:cp" => CORE_NS, 
                 :'xmlns:dc' => CORE_NS_DC, 
                 :'xmlns:dcmitype'=>CORE_NS_DCMIT, 
                 :'xmlns:dcterms'=>CORE_NS_DCT, 
                 :'xmlns:xsi'=>CORE_NS_XSI) {
          xml['dc'].creator self.creator
          xml['dcterms'].created Time.now.strftime('%Y-%m-%dT%H:%M:%S'), :'xsi:type'=>"dcterms:W3CDTF"
          xml['cp'].revision 0
        }
      end  
      builder.to_xml
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
axlsx-1.0.7 lib/axlsx/doc_props/core.rb~
axlsx-1.0.6 lib/axlsx/doc_props/core.rb~
axlsx-1.0.5 lib/axlsx/doc_props/core.rb~
axlsx-1.0.4 lib/axlsx/doc_props/core.rb~
axlsx-1.0.3 lib/axlsx/doc_props/core.rb~
axlsx-1.0.1 lib/axlsx/doc_props/core.rb~