Sha256: c0ab4baddb773d5c8097c8bb74f9f9f7e9573b40138b8319aec11306f7f6ad3b

Contents?: true

Size: 787 Bytes

Versions: 19

Compression:

Stored size: 787 Bytes

Contents

# frozen_string_literal: true

require_relative 'sparklines/sparkline'
module OoxmlParser
  # Class for `sparklines` data
  class Sparklines < OOXMLDocumentObject
    # @return [Array<Sparkline>] list of sparklines
    attr_reader :sparklines

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

    # @return [Sparkline] accessor
    def [](key)
      sparklines[key]
    end

    # Parse Sparklines data
    # @param [Nokogiri::XML:Element] node with Sparklines data
    # @return [Sparklines] value of Sparklines data
    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
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
ooxml_parser-0.38.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.37.1 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.37.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.36.1 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.36.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.35.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.34.2 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.34.1 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.34.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.33.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.32.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.31.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.30.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.29.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.28.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.27.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.26.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.25.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb
ooxml_parser-0.24.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension/sparkline_groups/sparkline_group/sparklines.rb