Class: OoxmlParser::Extension

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

Overview

Class for ‘ext` data

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#conditional_formattingsConditionalFormattings (readonly)

Returns list of conditional formattings.

Returns:



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

def conditional_formattings
  @conditional_formattings
end

#data_fieldX14DataField

Returns pivot data field in x14 namespace.

Returns:



20
21
22
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb', line 20

def data_field
  @data_field
end

#data_validationsDataValidations

Returns list of data validations.

Returns:



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

def data_validations
  @data_validations
end

#sparkline_groupsSparklineGroups (readonly)

Returns list of groups.

Returns:



18
19
20
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb', line 18

def sparkline_groups
  @sparkline_groups
end

#tableX14Table

Returns table data in x14 namespace.

Returns:

  • (X14Table)

    table data in x14 namespace



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

def table
  @table
end

Instance Method Details

#parse(node) ⇒ Extension

Parse Extension data

Parameters:

  • node (Nokogiri::XML:Element)

    with Extension data

Returns:



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/table_part/extension_list/extension.rb', line 25

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)
    when 'dataField'
      @data_field = X14DataField.new(parent: self).parse(column_node)
    end
  end
  self
end