Sha256: 1ddec0ade4e5f238cc57b024bae6eb932d21e10121167b401c71af53bba76901

Contents?: true

Size: 962 Bytes

Versions: 37

Compression:

Stored size: 962 Bytes

Contents

# frozen_string_literal: true

require_relative 'cache_field/shared_items'

module OoxmlParser
  # Class for parsing <cacheField> tag
  class CacheField < OOXMLDocumentObject
    # @return [String] name of field
    attr_reader :name
    # @return [Integer] number format id
    attr_reader :number_format_id
    # @return [SharedItems] shared items
    attr_reader :shared_items

    # 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 'name'
          @name = value.value.to_s
        when 'numFmtId'
          @number_format_id = value.value.to_i
        end
      end

      node.xpath('*').each do |node_child|
        case node_child.name
        when 'sharedItems'
          @shared_items = SharedItems.new(parent: self).parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
ooxml_parser-0.21.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.20.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.19.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.18.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.18.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.17.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.16.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.15.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.14.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.14.1-mingw32 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.14.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.14.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.13.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.12.2 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.12.1 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.12.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
ooxml_parser-0.11.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb