class OoxmlParser::PivotField

Class for parsing <pivotField> tag

Attributes

axis[R]

@return [String] axis value

items[R]

@return [Items] contain item

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/xlsx_data/view_model/workbook/pivot_table_definition/pivot_fields/pivot_field.rb, line 18
def parse(node)
  node.attributes.each do |key, value|
    case key
    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