Sha256: 09b4d7a429056122492b90d0efdfb75b88196c7870c275559a50c20f3d67a18b
Contents?: true
Size: 1.18 KB
Versions: 37
Compression:
Stored size: 1.18 KB
Contents
# frozen_string_literal: true require_relative 'pivot_cache_definition/cache_source' require_relative 'pivot_cache_definition/cache_fields' module OoxmlParser # Class for parsing <pivotCacheDefinition> file class PivotCacheDefinition < OOXMLDocumentObject # @return [String] id of pivot cache definition attr_reader :id # @return [CacheSource] source of pivot cache attr_reader :cache_source # @return [CacheFields] fields of pivot cache attr_reader :cache_fields # Parse PivotCacheDefinition file # @param file [String] path to file # @return [PivotCacheDefinition] def parse(file) return nil unless File.exist?(file) document = parse_xml(file) node = document.xpath('*').first node.attributes.each do |key, value| case key when 'id' @id = value.value.to_s end end node.xpath('*').each do |node_child| case node_child.name when 'cacheSource' @cache_source = CacheSource.new(parent: self).parse(node_child) when 'cacheFields' @cache_fields = CacheFields.new(parent: self).parse(node_child) end end self end end end
Version data entries
37 entries across 37 versions & 1 rubygems