Class: OoxmlParser::PivotFormats

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb

Overview

Parsing chart ‘c:pivotFmts`

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

#initialize(parent: nil) ⇒ PivotFormats

Returns a new instance of PivotFormats.



10
11
12
13
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb', line 10

def initialize(parent: nil)
  @pivot_formats_list = []
  super
end

Instance Attribute Details

#pivot_formats_listArray<PivotFormat> (readonly)

Returns list of pivot formats.

Returns:



8
9
10
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb', line 8

def pivot_formats_list
  @pivot_formats_list
end

Instance Method Details

#[](key) ⇒ Array, PivotFormat

Returns accessor.

Returns:



16
17
18
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb', line 16

def [](key)
  @pivot_formats_list[key]
end

#parse(node) ⇒ PivotFormats

Parse PivotFormats object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



23
24
25
26
27
28
29
30
31
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb', line 23

def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'pivotFmt'
      @pivot_formats_list << PivotFormat.new(parent: self).parse(node_child)
    end
  end
  self
end