Class: OoxmlParser::PivotCache

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/workbook/pivot_cache.rb

Overview

Class for parsing <pivotCache> tag

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#cache_idInteger (readonly)

Returns cacheId of pivot cache.

Returns:

  • (Integer)

    cacheId of pivot cache



9
10
11
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache.rb', line 9

def cache_id
  @cache_id
end

#idString (readonly)

Returns id of pivot cache.

Returns:

  • (String)

    id of pivot cache



11
12
13
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache.rb', line 11

def id
  @id
end

#pivot_cache_definitionPivotCacheDefinition (readonly)

Returns parsed pivot cache definition.

Returns:



13
14
15
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache.rb', line 13

def pivot_cache_definition
  @pivot_cache_definition
end

Instance Method Details

#parse(node) ⇒ PivotCache

Parse Pivot Cache data

Parameters:

  • node (Nokogiri::XML:Element)

    with Pivot Cache data

Returns:



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache.rb', line 18

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'cacheId'
      @cache_id = value.value.to_i
    when 'id'
      @id = value.value.to_s
    end
  end
  parse_pivot_cache_definition
  self
end