class OoxmlParser::NumberingLevel

This element specifies the appearance and behavior of a numbering level within a given abstract numbering

Attributes

ilvl[RW]

@return [Integer] level id

justification[RW]

@return [LevelJustification] justification of level

numbering_format[RW]

@return [NumberingFormat] numbering format data

paragraph_properties[RW]

@return [ParagraphProperties] properties of paragraph

run_properties[RW]

@return [RunProperties] properties of run

start[RW]

@return [Start] start data

suffix[RW]

@return [Suffix] value of Suffix

text[RW]

@return [LevelText] level text

Public Class Methods

new(parent: nil) click to toggle source
Calls superclass method OoxmlParser::OOXMLDocumentObject::new
# File lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/abstract_numbering/numbering_level.rb, line 28
def initialize(parent: nil)
  @suffix = Suffix.new(parent: self)
  super
end

Public Instance Methods

parse(node) click to toggle source

Parse Numbering Level data @param [Nokogiri::XML:Element] node with Numbering Level data @return [NumberingLevel] value of Numbering Level data

# File lib/ooxml_parser/docx_parser/docx_data/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