Class: OpenXml::Docx::Parts::Footer

Inherits:
Part
  • Object
show all
Includes:
RootNamespaces
Defined in:
lib/openxml/docx/parts/footer.rb

Constant Summary

Constants included from RootNamespaces

RootNamespaces::POSSIBLE_NAMESPACES

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from RootNamespaces

included

Constructor Details

#initializeFooter

Returns a new instance of Footer.



12
13
14
# File 'lib/openxml/docx/parts/footer.rb', line 12

def initialize
  @children = []
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



10
11
12
# File 'lib/openxml/docx/parts/footer.rb', line 10

def children
  @children
end

Instance Method Details

#<<(child) ⇒ Object



16
17
18
# File 'lib/openxml/docx/parts/footer.rb', line 16

def <<(child)
  children << child
end

#to_xmlObject



20
21
22
23
24
25
26
27
# File 'lib/openxml/docx/parts/footer.rb', line 20

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