Class: OoxmlParser::NumberingDefinition
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::NumberingDefinition
- Defined in:
- lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
Overview
This element specifies a unique instance of numbering information that can be referenced by zero or more paragraphs within the parent WordprocessingML document.
Instance Attribute Summary collapse
-
#abstract_numbering_id ⇒ ValuedChild
Abstract numbering id.
-
#id ⇒ Integer
Num id.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ NumberingDefinition
Parse NumberingDefinition data.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#abstract_numbering_id ⇒ ValuedChild
Returns abstract numbering id.
10 11 12 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb', line 10 def abstract_numbering_id @abstract_numbering_id end |
#id ⇒ Integer
Returns num id.
8 9 10 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb', line 8 def id @id end |
Instance Method Details
#parse(node) ⇒ NumberingDefinition
Parse NumberingDefinition data
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb', line 15 def parse(node) node.attributes.each do |key, value| case key when 'numId' @id = value.value.to_f end end node.xpath('*').each do |numbering_child_node| case numbering_child_node.name when 'abstractNumId' @abstract_numbering_id = ValuedChild.new(:integer, parent: self).parse(numbering_child_node) end end self end |