Class: OoxmlParser::ChartCellsRange
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::ChartCellsRange
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb
Overview
Cell Range of Chart
Instance Attribute Summary collapse
-
#list ⇒ Object
Returns the value of attribute list.
-
#points ⇒ Object
Returns the value of attribute points.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ ChartCellsRange
constructor
A new instance of ChartCellsRange.
-
#parse(node) ⇒ ChartCellsRange
Parse ChartCellsRange object.
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
Constructor Details
#initialize(parent: nil) ⇒ ChartCellsRange
Returns a new instance of ChartCellsRange.
6 7 8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb', line 6 def initialize(parent: nil) @list = '' @points = [] @parent = parent end |
Instance Attribute Details
#list ⇒ Object
Returns the value of attribute list.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb', line 4 def list @list end |
#points ⇒ Object
Returns the value of attribute points.
4 5 6 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb', line 4 def points @points end |
Instance Method Details
#parse(node) ⇒ ChartCellsRange
Parse ChartCellsRange object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb', line 15 def parse(node) @list = node.xpath('c:f')[0].text.split('!').first coordinates = Coordinates.parser_coordinates_range(node.xpath('c:f')[0].text) # .split('!')[1].gsub('$', '')) node.xpath('c:numCache/c:pt').each_with_index do |point_node, index| point = ChartPoint.new(coordinates[index]) point.value = point_node.xpath('c:v').first.text.to_f unless point_node.xpath('c:v').first.nil? @points << point end self end |