Class: OoxmlParser::SparklineGroups

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb

Overview

Class for ‘sparklineGroups` data

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

Returns a new instance of SparklineGroups.



8
9
10
11
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb', line 8

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

Instance Attribute Details

#sparklines_groupsArray<SparklineGroup> (readonly)

Returns list of sparkline group.

Returns:



6
7
8
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb', line 6

def sparklines_groups
  @sparklines_groups
end

Instance Method Details

#[](key) ⇒ Array, SparklineGroups

Returns accessor.

Returns:



14
15
16
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb', line 14

def [](key)
  sparklines_groups[key]
end

#parse(node) ⇒ SparklineGroups

Parse SparklineGroups data

Parameters:

  • node (Nokogiri::XML:Element)

    with SparklineGroups data

Returns:



21
22
23
24
25
26
27
28
29
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb', line 21

def parse(node)
  node.xpath('*').each do |column_node|
    case column_node.name
    when 'sparklineGroup'
      @sparklines_groups << SparklineGroup.new(parent: self).parse(column_node)
    end
  end
  self
end