Class: OoxmlParser::NumberStringCache

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

Overview

Class for parsing ‘c:tx`, `c:numCache` object

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) ⇒ NumberStringCache

Returns a new instance of NumberStringCache.



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

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

Instance Attribute Details

#format_codeString (readonly)

Returns Format Code.

Returns:

  • (String)

    Format Code



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

def format_code
  @format_code
end

#point_countStringReference (readonly)

Returns String reference of series.

Returns:

  • (StringReference)

    String reference of series



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

def point_count
  @point_count
end

#pointsArray, Point (readonly)

Returns array of points.

Returns:

  • (Array, Point)

    array of points



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

def points
  @points
end

Instance Method Details

#parse(node) ⇒ Order

Parse Order

Parameters:

  • node (Nokogiri::XML:Node)

    with Order

Returns:

  • (Order)

    result of parsing



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

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