Class: OpenXml::Docx::Parts::Numbering
- Inherits:
-
Part
- Object
- Part
- OpenXml::Docx::Parts::Numbering
- Includes:
- RootNamespaces
- Defined in:
- lib/openxml/docx/parts/numbering.rb
Constant Summary
Constants included from RootNamespaces
RootNamespaces::POSSIBLE_NAMESPACES
Instance Attribute Summary collapse
-
#abstractNumbers ⇒ Object
readonly
Returns the value of attribute abstractNumbers.
-
#numbers ⇒ Object
readonly
Returns the value of attribute numbers.
Instance Method Summary collapse
- #<<(child) ⇒ Object
- #count ⇒ Object
-
#initialize ⇒ Numbering
constructor
A new instance of Numbering.
- #to_xml ⇒ Object
Methods included from RootNamespaces
Constructor Details
Instance Attribute Details
#abstractNumbers ⇒ Object (readonly)
Returns the value of attribute abstractNumbers.
7 8 9 |
# File 'lib/openxml/docx/parts/numbering.rb', line 7 def abstractNumbers @abstractNumbers end |
#numbers ⇒ Object (readonly)
Returns the value of attribute numbers.
7 8 9 |
# File 'lib/openxml/docx/parts/numbering.rb', line 7 def numbers @numbers end |
Instance Method Details
#<<(child) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/openxml/docx/parts/numbering.rb', line 17 def <<(child) if child.is_a?(OpenXml::Docx::Elements::AbstractNumbering) abstractNumbers << child elsif child.is_a?(OpenXml::Docx::Elements::Numbering) numbers << child end end |
#count ⇒ Object
25 26 27 |
# File 'lib/openxml/docx/parts/numbering.rb', line 25 def count abstractNums.count end |
#to_xml ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/openxml/docx/parts/numbering.rb', line 29 def to_xml build_standalone_xml do |xml| xml.numbering(root_namespaces) { xml.parent.namespace = :w abstractNumbers.each { |num| num.to_xml(xml) } numbers.each { |number| number.to_xml(xml) } } end end |