Class: OoxmlParser::AbstractNumbering
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::AbstractNumbering
- Defined in:
- lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering.rb
Overview
This element specifies a set of properties which shall dictate the appearance and behavior of a set of numbered paragraphs in a WordprocessingML document.
Instance Attribute Summary collapse
-
#id ⇒ Integer
Abstruct numbering id.
-
#level_list ⇒ Array, NumberingLevel
Numbering level data list.
-
#multilevel_type ⇒ MultilevelType
Myltylevel type.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ AbstractNumbering
constructor
A new instance of AbstractNumbering.
-
#parse(node) ⇒ AbstractNumbering
Parse Abstract Numbering data.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ AbstractNumbering
Returns a new instance of AbstractNumbering.
17 18 19 20 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering.rb', line 17 def initialize(parent: nil) @level_list = [] super end |
Instance Attribute Details
#id ⇒ Integer
Returns abstruct numbering id.
11 12 13 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering.rb', line 11 def id @id end |
#level_list ⇒ Array, NumberingLevel
Returns numbering level data list.
15 16 17 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering.rb', line 15 def level_list @level_list end |
#multilevel_type ⇒ MultilevelType
Returns myltylevel type.
13 14 15 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering.rb', line 13 def multilevel_type @multilevel_type end |
Instance Method Details
#parse(node) ⇒ AbstractNumbering
Parse Abstract Numbering data
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering.rb', line 25 def parse(node) node.attributes.each do |key, value| case key when 'abstractNumId' @id = value.value.to_f end end node.xpath('*').each do |numbering_child_node| case numbering_child_node.name when 'multiLevelType' @multilevel_type = MultilevelType.new(parent: self).parse(numbering_child_node) when 'lvl' @level_list << NumberingLevel.new(parent: self).parse(numbering_child_node) end end self end |