Class: OoxmlParser::CacheSource
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::CacheSource
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_source.rb
Overview
Class for parsing <cacheSource> file
Instance Attribute Summary collapse
-
#type ⇒ String
readonly
Type.
-
#worksheet_source ⇒ WorksheetSource
readonly
Source of worksheet data.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ CacheSource
Parse ‘<cacheSource>` tag # @param [Nokogiri::XML:Element] node with CacheSource data.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#type ⇒ String (readonly)
Returns type.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_source.rb', line 9 def type @type end |
#worksheet_source ⇒ WorksheetSource (readonly)
Returns source of worksheet data.
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_source.rb', line 11 def worksheet_source @worksheet_source end |
Instance Method Details
#parse(node) ⇒ CacheSource
Parse ‘<cacheSource>` tag # @param [Nokogiri::XML:Element] node with CacheSource data
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_source.rb', line 16 def parse(node) node.attributes.each do |key, value| case key when 'type' @type = value.value.to_s end end node.xpath('*').each do |node_child| case node_child.name when 'worksheetSource' @worksheet_source = WorksheetSource.new(parent: self).parse(node_child) end end self end |