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
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ ChartCellsRange
Returns a new instance of ChartCellsRange.
8 9 10 11 12 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb', line 8 def initialize(parent: nil) @list = '' @points = [] super end |
Instance Attribute Details
#list ⇒ Object
Returns the value of attribute list.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb', line 6 def list @list end |
#points ⇒ Object
Returns the value of attribute points.
6 7 8 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb', line 6 def points @points end |
Instance Method Details
#parse(node) ⇒ ChartCellsRange
Parse ChartCellsRange object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb', line 17 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('$', '')) return self unless coordinates 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 |