Class: OoxmlParser::SparklineGroups

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/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

#==, #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) ⇒ SparklineGroups

Returns a new instance of SparklineGroups.



10
11
12
13
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb', line 10

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

Instance Attribute Details

#sparklines_groupsArray<SparklineGroup> (readonly)

Returns list of sparkline group.

Returns:



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

def sparklines_groups
  @sparklines_groups
end

Instance Method Details

#[](key) ⇒ SparklineGroup

Returns accessor.

Returns:



16
17
18
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups.rb', line 16

def [](key)
  sparklines_groups[key]
end

#parse(node) ⇒ SparklineGroups

Parse SparklineGroups data

Parameters:

  • node (Nokogiri::XML:Element)

    with SparklineGroups data

Returns:



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

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