Class: OoxmlParser::Sparklines
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Sparklines
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
Overview
Class for ‘sparklines` data
Instance Attribute Summary collapse
-
#sparklines ⇒ Array<Sparkline>
readonly
List of sparklines.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#[](key) ⇒ Sparkline
Accessor.
-
#initialize(parent: nil) ⇒ Sparklines
constructor
A new instance of Sparklines.
-
#parse(node) ⇒ Sparklines
Parse Sparklines data.
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) ⇒ Sparklines
Returns a new instance of Sparklines.
10 11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb', line 10 def initialize(parent: nil) @sparklines = [] super end |
Instance Attribute Details
#sparklines ⇒ Array<Sparkline> (readonly)
Returns list of sparklines.
8 9 10 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb', line 8 def sparklines @sparklines end |
Instance Method Details
#[](key) ⇒ Sparkline
Returns accessor.
16 17 18 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb', line 16 def [](key) sparklines[key] end |
#parse(node) ⇒ Sparklines
Parse Sparklines data
23 24 25 26 27 28 29 30 31 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb', line 23 def parse(node) node.xpath('*').each do |column_node| case column_node.name when 'sparkline' @sparklines << Sparkline.new(parent: self).parse(column_node) end end self end |