Sha256: 3d237975a43273303d019c73068262fe8b4ce74d9b6e134faadc41098b807c92

Contents?: true

Size: 754 Bytes

Versions: 4

Compression:

Stored size: 754 Bytes

Contents

require_relative 'extension_list/extension'
module OoxmlParser
  # Class for `extLst` data
  class ExtensionList < OOXMLDocumentObject
    attr_accessor :extension_array

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

    # @return [Array, Extension] accessor
    def [](key)
      @extension_array[key]
    end

    # Parse ExtensionList data
    # @param [Nokogiri::XML:Element] node with ExtensionList data
    # @return [ExtensionList] value of ExtensionList data
    def parse(node)
      node.xpath('*').each do |column_node|
        case column_node.name
        when 'ext'
          @extension_array << Extension.new(parent: self).parse(column_node)
        end
      end
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ooxml_parser-0.4.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb
ooxml_parser-0.4.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb
ooxml_parser-0.3.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb
ooxml_parser-0.2.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb