class OoxmlParser::PivotField
Class for parsing <pivotField> tag
Attributes
axis[R]
@return [String] axis value
items[R]
@return [Items] contain item
name[R]
@return [String] field name
show_all[R]
@return [True, False] should show all
Public Instance Methods
parse(node)
click to toggle source
Parse ‘<pivotField>` tag # @param [Nokogiri::XML:Element] node with PivotField
data @return [PivotField]
# File lib/ooxml_parser/xlsx_parser/workbook/pivot_table_definition/pivot_fields/pivot_field.rb, line 20 def parse(node) node.attributes.each do |key, value| case key when 'name' @name = value.value.to_s when 'axis' @axis = value.value.to_s when 'showAll' @show_all = attribute_enabled?(value) end end node.xpath('*').each do |node_child| case node_child.name when 'items' @items = Items.new(parent: self).parse(node_child) end end self end