Sha256: 1bd386ffb1974d6dd2b5c156cadb9379a5b3e35662c97278359dcdd9a111175b

Contents?: true

Size: 1 KB

Versions: 48

Compression:

Stored size: 1 KB

Contents

# frozen_string_literal: true

module OoxmlParser
  # This element specifies a unique instance of numbering information that can be referenced by zero or more
  # paragraphs within the parent WordprocessingML document.
  class NumberingDefinition < OOXMLDocumentObject
    # @return [Integer] num id
    attr_accessor :id
    # @return [ValuedChild] abstract numbering id
    attr_accessor :abstract_numbering_id

    # Parse NumberingDefinition data
    # @param [Nokogiri::XML:Element] node with NumberingDefinition data
    # @return [NumberingDefinition] value of Abstract Numbering data
    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
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
ooxml_parser-0.37.1 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.37.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.36.1 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.36.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.35.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.34.2 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.34.1 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.34.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.33.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.32.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.31.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.30.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.29.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.28.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.27.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.26.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.25.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.24.0 lib/ooxml_parser/docx_parser/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.23.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb
ooxml_parser-0.22.0 lib/ooxml_parser/docx_parser/docx_data/document_structure/numbering/numbering_definition.rb