Class: OoxmlParser::ChartCellsRange
- Inherits:
-
Object
- Object
- OoxmlParser::ChartCellsRange
- Defined in:
- lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb
Instance Attribute Summary collapse
-
#list ⇒ Object
Returns the value of attribute list.
-
#points ⇒ Object
Returns the value of attribute points.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(list = '', points = []) ⇒ ChartCellsRange
constructor
A new instance of ChartCellsRange.
Constructor Details
#initialize(list = '', points = []) ⇒ ChartCellsRange
Returns a new instance of ChartCellsRange.
6 7 8 9 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb', line 6 def initialize(list = '', points = []) @list = list @points = points 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 |
Class Method Details
.parse(num_ref_node) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ooxml_parser/common_parser/common_data/alternate_content/chart/chart_cells_range.rb', line 11 def self.parse(num_ref_node) chart_range = ChartCellsRange.new chart_range.list = num_ref_node.xpath('c:f')[0].text.split('!').first coordinates = Coordinates.parser_coordinates_range(num_ref_node.xpath('c:f')[0].text) # .split('!')[1].gsub('$', '')) num_ref_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? chart_range.points << point end chart_range end |