Class: OoxmlParser::CacheField
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::CacheField
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb
Overview
Class for parsing <cacheField> tag
Instance Attribute Summary collapse
-
#name ⇒ String
readonly
Name of field.
-
#number_format_id ⇒ Integer
readonly
Number format id.
-
#shared_items ⇒ SharedItems
readonly
Shared items.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ CacheField
Parse ‘<cacheField>` tag # @param [Nokogiri::XML:Element] node with WorksheetSource 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
#name ⇒ String (readonly)
Returns name of field.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb', line 9 def name @name end |
#number_format_id ⇒ Integer (readonly)
Returns number format id.
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb', line 11 def number_format_id @number_format_id end |
#shared_items ⇒ SharedItems (readonly)
Returns shared items.
13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb', line 13 def shared_items @shared_items end |
Instance Method Details
#parse(node) ⇒ CacheField
Parse ‘<cacheField>` tag # @param [Nokogiri::XML:Element] node with WorksheetSource data
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/pivot_cache/pivot_cache_definition/cache_fields/cache_field.rb', line 18 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 |