Class: OoxmlParser::CacheFields
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::CacheFields
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb
Overview
Class for parsing <cacheFields> tag
Instance Attribute Summary collapse
-
#cache_field ⇒ Array<CacheField>
readonly
List of CacheField object.
-
#count ⇒ Integer
readonly
Count.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#[](key) ⇒ CacheField
Accessor.
-
#initialize(parent: nil) ⇒ CacheFields
constructor
A new instance of CacheFields.
-
#parse(node) ⇒ cacheFields
Parse ‘<cacheFields>` tag.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ CacheFields
Returns a new instance of CacheFields.
13 14 15 16 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb', line 13 def initialize(parent: nil) @cache_field = [] super end |
Instance Attribute Details
#cache_field ⇒ Array<CacheField> (readonly)
Returns list of CacheField object.
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb', line 11 def cache_field @cache_field end |
#count ⇒ Integer (readonly)
Returns count.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb', line 9 def count @count end |
Instance Method Details
#[](key) ⇒ CacheField
Returns accessor.
19 20 21 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb', line 19 def [](key) @cache_field[key] end |
#parse(node) ⇒ cacheFields
Parse ‘<cacheFields>` tag
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields.rb', line 26 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 |