Class: OoxmlParser::Series

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

Overview

Class for parsing ‘c:ser` object

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, #initialize, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#categoriesCategories

Returns categories of chart.

Returns:



14
15
16
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 14

def categories
  @categories
end

#display_labelsDisplayLabelsProperties



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

def display_labels
  @display_labels
end

#indexIndex

Returns index of chart.

Returns:

  • (Index)

    index of chart



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

def index
  @index
end

#orderOrder

Returns order of chart.

Returns:

  • (Order)

    order of chart



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

def order
  @order
end

#textSeriesText

Returns text of series.

Returns:



12
13
14
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 12

def text
  @text
end

Instance Method Details

#parse(node) ⇒ Series

Parse Series

Parameters:

  • node (Nokogiri::XML:Node)

    with Series

Returns:

  • (Series)

    result of parsing



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series.rb', line 21

def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'idx'
      @index = SeriesIndex.new(parent: self).parse(node_child)
    when 'order'
      @order = Order.new(parent: self).parse(node_child)
    when 'tx'
      @text = SeriesText.new(parent: self).parse(node_child)
    when 'cat'
      @categories = Categories.new(parent: self).parse(node_child)
    when 'dLbls'
      @display_labels = DisplayLabelsProperties.new(parent: self).parse(node_child)
    end
  end
  self
end