Sha256: 2cbca353c21c43e8b62d4e9dc5081b667ad786aa9e7f6bffe007f9edc1d87287

Contents?: true

Size: 1.36 KB

Versions: 26

Compression:

Stored size: 1.36 KB

Contents

# frozen_string_literal: true

require_relative 'extension/data_validations'
require_relative 'extension/sparkline_groups'
require_relative 'extension/x14_table'
require_relative 'extension/conditional_formattings'
module OoxmlParser
  # Class for `ext` data
  class Extension < OOXMLDocumentObject
    # @return [DataValidations] list of data validations
    attr_accessor :data_validations
    # @return [ConditionalFormattings] list of conditional formattings
    attr_reader :conditional_formattings
    # @return [X14Table] table data in x14 namespace
    attr_accessor :table
    # @return [SparklineGroups] list of groups
    attr_reader :sparkline_groups

    # Parse Extension data
    # @param [Nokogiri::XML:Element] node with Extension data
    # @return [Extension] value of Extension data
    def parse(node)
      node.xpath('*').each do |column_node|
        case column_node.name
        when 'dataValidations'
          @data_validations = DataValidations.new(parent: self).parse(column_node)
        when 'conditionalFormattings'
          @conditional_formattings = ConditionalFormattings.new(parent: self).parse(column_node)
        when 'table'
          @table = X14Table.new(parent: self).parse(column_node)
        when 'sparklineGroups'
          @sparkline_groups = SparklineGroups.new(parent: self).parse(column_node)
        end
      end
      self
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
ooxml_parser-0.36.1 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.36.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.35.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.34.2 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.34.1 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.34.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.33.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.32.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.31.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.30.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.29.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.28.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.27.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.26.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.25.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.24.0 lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.23.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.22.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.21.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb
ooxml_parser-0.20.0 lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list/extension.rb