Class: Uniword::Wordprocessingml::Footnotes

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/uniword/wordprocessingml/footnotes.rb

Overview

Footnotes collection

Generated from OOXML schema: wordprocessingml.yml Element: <w:footnotes>

Instance Method Summary collapse

Instance Method Details

#sync_element_orderObject



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/uniword/wordprocessingml/footnotes.rb', line 23

def sync_element_order
  return if element_order.nil? || element_order.empty?

  counts = element_order.each_with_object(Hash.new(0)) do |e, h|
    h[e.name] += 1
  end

  missing = footnote_entries.size - counts["footnote"]
  missing.times do
    element_order << Lutaml::Xml::Element.new("Element", "footnote")
  end
end

#to_xml(options = {}) ⇒ Object



36
37
38
39
# File 'lib/uniword/wordprocessingml/footnotes.rb', line 36

def to_xml(options = {})
  sync_element_order
  super
end