Class: OoxmlParser::NumberingLevel
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::NumberingLevel
- Defined in:
- lib/ooxml_parser/docx_parser/docx_data/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
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ NumberingLevel
Returns a new instance of NumberingLevel.
27 28 29 30 |
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb', line 27 def initialize(parent: nil) @parent = parent @suffix = Suffix.new(parent: self) end |
Instance Attribute Details
#ilvl ⇒ Integer
Returns level id.
11 12 13 |
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb', line 11 def ilvl @ilvl end |
#justification ⇒ LevelJustification
Returns justification of level.
19 20 21 |
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb', line 19 def justification @justification end |
#numbering_format ⇒ NumberingFormat
Returns numbering format data.
15 16 17 |
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb', line 15 def numbering_format @numbering_format end |
#paragraph_properties ⇒ ParagraphProperties
Returns properties of paragraph.
21 22 23 |
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb', line 21 def paragraph_properties @paragraph_properties end |
#run_properties ⇒ RunProperties
Returns properties of run.
23 24 25 |
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb', line 23 def run_properties @run_properties end |
#start ⇒ Start
Returns start data.
13 14 15 |
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb', line 13 def start @start end |
#suffix ⇒ Suffix
Returns value of Suffix.
25 26 27 |
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb', line 25 def suffix @suffix end |
#text ⇒ LevelText
Returns level text.
17 18 19 |
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb', line 17 def text @text end |
Instance Method Details
#parse(node) ⇒ NumberingLevel
Parse Numbering Level data
35 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 |
# File 'lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb', line 35 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 = Start.new(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 |