Class: OoxmlParser::StringCache

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

Overview

Class for parsing ‘c:tx` 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, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

#initialize(parent: nil) ⇒ StringCache

Returns a new instance of StringCache.



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

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

Instance Attribute Details

#point_countStringReference

Returns String reference of series.

Returns:



7
8
9
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache.rb', line 7

def point_count
  @point_count
end

#pointsArray, Point

Returns array of points.

Returns:

  • (Array, Point)

    array of points



9
10
11
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache.rb', line 9

def points
  @points
end

Instance Method Details

#parse(node) ⇒ Order

Parse Order

Parameters:

  • node (Nokogiri::XML:Node)

    with Order

Returns:

  • (Order)

    result of parsing



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart/series/series_text/string_reference/string_cache.rb', line 19

def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'ptCount'
      @point_count = PointCount.new(parent: self).parse(node_child)
    when 'pt'
      @points << Point.new(parent: self).parse(node_child)
    end
  end
  self
end