Sha256: 355fc84c9843738ea1e334a54a63b2d6568793e41a1d30a1caa05083dc21ed4c
Contents?: true
Size: 1003 Bytes
Versions: 37
Compression:
Stored size: 1003 Bytes
Contents
# frozen_string_literal: true require_relative 'column_row_items/column_row_item' module OoxmlParser # Class for parsing <rowItems> and <colItems> tag class ColumnRowItems < OOXMLDocumentObject # @return [Integer] count of items attr_reader :count # @return [Array<RowColumnItem>] list of RowColumnItem object attr_reader :items def initialize(parent: nil) @items = [] super end # @return [RowColumnItem] accessor def [](key) @items[key] end # Parse `<cacheField>` tag # # @param [Nokogiri::XML:Element] node with WorksheetSource data # @return [CacheField] def parse(node) node.attributes.each do |key, value| case key when 'count' @count = value.value.to_i end end node.xpath('*').each do |node_child| case node_child.name when 'i' @items << ColumnRowItem.new(parent: self).parse(node_child) end end self end end end
Version data entries
37 entries across 37 versions & 1 rubygems