Sha256: aab9c515c6e9674d0a6eab656834f48e51456a502b5d382dc393d5d9a2033e80

Contents?: true

Size: 843 Bytes

Versions: 8

Compression:

Stored size: 843 Bytes

Contents

# frozen_string_literal: true

require_relative 'pivot_formats/pivot_format'
module OoxmlParser
  # Parsing chart `c:pivotFmts`
  class PivotFormats < OOXMLDocumentObject
    # @return [Array<PivotFormat>] list of pivot formats
    attr_reader :pivot_formats_list

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

    # @return [Array, PivotFormat] accessor
    def [](key)
      @pivot_formats_list[key]
    end

    # Parse PivotFormats object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [PivotFormats] result of parsing
    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
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ooxml_parser-0.8.1 lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb
ooxml_parser-0.8.0 lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb
ooxml_parser-0.7.2 lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb
ooxml_parser-0.7.1 lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb
ooxml_parser-0.7.0 lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb
ooxml_parser-0.6.0 lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb
ooxml_parser-0.5.1 lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb
ooxml_parser-0.5.0 lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/pivot_formats.rb