Sha256: 10380624e266809049a903e263aa0f952e13aae2c61a9fbf7afe7728d81a1b25

Contents?: true

Size: 680 Bytes

Versions: 9

Compression:

Stored size: 680 Bytes

Contents

# frozen_string_literal: true

require_relative 'combobox/list_item'
module OoxmlParser
  # Class for parsing `comboBox` tag
  class ComboBox < OOXMLDocumentObject
    # @return [Array<ListItem>] combobox items
    attr_reader :list_items

    def initialize(parent: nil)
      @list_items = []
      super
    end

    # Parse ComboBox object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [ComboBox] result of parsing
    def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'listItem'
          @list_items << ListItem.new(parent: self).parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
ooxml_parser-0.37.1 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/combobox.rb
ooxml_parser-0.37.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/combobox.rb
ooxml_parser-0.36.1 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/combobox.rb
ooxml_parser-0.36.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/combobox.rb
ooxml_parser-0.35.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/combobox.rb
ooxml_parser-0.34.2 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/combobox.rb
ooxml_parser-0.34.1 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/combobox.rb
ooxml_parser-0.34.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/combobox.rb
ooxml_parser-0.33.0 lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/combobox.rb