Class: OoxmlParser::NumberingLevel
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::NumberingLevel
- Defined in:
- lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level.rb
Overview
This element specifies the appearance and behavior of a numbering level within a given abstract numbering
Instance Attribute Summary collapse
-
#ilvl ⇒ Integer
Level id.
-
#justification ⇒ LevelJustification
Justification of level.
-
#numbering_format ⇒ NumberingFormat
Numbering format data.
-
#paragraph_properties ⇒ ParagraphProperties
Properties of paragraph.
-
#run_properties ⇒ RunProperties
Properties of run.
-
#start ⇒ Start
Start data.
-
#suffix ⇒ Suffix
Value of Suffix.
-
#text ⇒ LevelText
Level text.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ NumberingLevel
constructor
A new instance of NumberingLevel.
-
#parse(node) ⇒ NumberingLevel
Parse Numbering Level 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) ⇒ NumberingLevel
Returns a new instance of NumberingLevel.
28 29 30 31 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level.rb', line 28 def initialize(parent: nil) @suffix = Suffix.new(parent: self) super end |
Instance Attribute Details
#ilvl ⇒ Integer
Returns level id.
12 13 14 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level.rb', line 12 def ilvl @ilvl end |
#justification ⇒ LevelJustification
Returns justification of level.
20 21 22 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level.rb', line 20 def justification @justification end |
#numbering_format ⇒ NumberingFormat
Returns numbering format data.
16 17 18 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level.rb', line 16 def numbering_format @numbering_format end |
#paragraph_properties ⇒ ParagraphProperties
Returns properties of paragraph.
22 23 24 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level.rb', line 22 def paragraph_properties @paragraph_properties end |
#run_properties ⇒ RunProperties
Returns properties of run.
24 25 26 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level.rb', line 24 def run_properties @run_properties end |
#start ⇒ Start
Returns start data.
14 15 16 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level.rb', line 14 def start @start end |
#suffix ⇒ Suffix
Returns value of Suffix.
26 27 28 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level.rb', line 26 def suffix @suffix end |
#text ⇒ LevelText
Returns level text.
18 19 20 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level.rb', line 18 def text @text end |
Instance Method Details
#parse(node) ⇒ NumberingLevel
Parse Numbering Level data
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/ooxml_parser/docx_parser/document_structure/numbering/abstract_numbering/numbering_level.rb', line 36 def parse(node) node.attributes.each do |key, value| case key when 'ilvl' @ilvl = value.value.to_f end end node.xpath('*').each do |num_level_child| case num_level_child.name when 'start' @start = ValuedChild.new(:integer, parent: self).parse(num_level_child) when 'numFmt' @numbering_format = NumberingFormat.new(parent: self).parse(num_level_child) when 'lvlText' @text = LevelText.new(parent: self).parse(num_level_child) when 'lvlJc' @justification = LevelJustification.new(parent: self).parse(num_level_child) when 'pPr' @paragraph_properties = ParagraphProperties.new(parent: self).parse(num_level_child) when 'rPr' @run_properties = RunProperties.new(parent: self).parse(num_level_child) when 'suff' @suffix = @suffix.parse(num_level_child) end end self end |