Sha256: 3ff1e308348fe2b7dc55eeaeccc89ad937aeb8e993c158b707ced9575fccce53

Contents?: true

Size: 767 Bytes

Versions: 12

Compression:

Stored size: 767 Bytes

Contents

module OpenXml
  module Docx
    module Parts
      class Header < OpenXml::Part
        include RootNamespaces

        use_namespaces :wpc, :mo, :mv, :o, :r, :m, :v, :wp14, :wp, :w10, :w14, :w15, :wpg, :wpi, :wne, :wps, :w, :mc, :a, :a14, :pic
        can_ignore :w14, :w15, :wp14, :a14

        attr_reader :children, :relationships

        def initialize
          @children = []
          @relationships = OpenXml::Parts::Rels.new
        end

        def <<(child)
          children << child
        end

        def to_xml
          build_xml do |xml|
            xml.hdr(root_namespaces) {
              xml.parent.namespace = :w
              children.each { |child| child.to_xml(xml) }
            }
          end
        end

      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
openxml-docx-0.11.5 lib/openxml/docx/parts/header.rb
openxml-docx-0.11.4 lib/openxml/docx/parts/header.rb
openxml-docx-0.11.3 lib/openxml/docx/parts/header.rb
openxml-docx-0.11.2 lib/openxml/docx/parts/header.rb
openxml-docx-0.11.1 lib/openxml/docx/parts/header.rb
openxml-docx-0.11.0 lib/openxml/docx/parts/header.rb
openxml-docx-0.11.0.rc lib/openxml/docx/parts/header.rb
openxml-docx-0.10.6 lib/openxml/docx/parts/header.rb
openxml-docx-0.10.5 lib/openxml/docx/parts/header.rb
openxml-docx-0.10.4 lib/openxml/docx/parts/header.rb
openxml-docx-0.10.3 lib/openxml/docx/parts/header.rb
openxml-docx-0.10.2 lib/openxml/docx/parts/header.rb