Sha256: 2bd9547a9fb616a3a020bf5e20593bbd080ae6be096d8bde9a67ea64dc2a6f24

Contents?: true

Size: 988 Bytes

Versions: 38

Compression:

Stored size: 988 Bytes

Contents

# frozen_string_literal: true

require_relative 'cache_fields/cache_field'

module OoxmlParser
  # Class for parsing <cacheFields> tag
  class CacheFields < OOXMLDocumentObject
    # @return [Integer] count
    attr_reader :count
    # @return [Array<CacheField>] list of CacheField object
    attr_reader :cache_field

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

    # @return [CacheField] accessor
    def [](key)
      @cache_field[key]
    end

    # Parse `<cacheFields>` tag
    # @param [Nokogiri::XML:Element] node with cacheFields data
    # @return [cacheFields]
    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 'cacheField'
          @cache_field << CacheField.new(parent: self).parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
ooxml_parser-0.38.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.37.1 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.37.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.36.1 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.36.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.35.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.34.2 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.34.1 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.34.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.33.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.32.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.31.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.30.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.29.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.28.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.27.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.26.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.25.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.24.0 lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
ooxml_parser-0.23.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb