Class: OoxmlParser::ExtensionList

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

Overview

Class for ‘extLst` 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) ⇒ ExtensionList

Returns a new instance of ExtensionList.



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

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

Instance Attribute Details

#extension_arrayObject

Returns the value of attribute extension_array.



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

def extension_array
  @extension_array
end

Instance Method Details

#[](key) ⇒ Array, Extension

Returns accessor.

Returns:



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

def [](key)
  @extension_array[key]
end

#parse(node) ⇒ ExtensionList

Parse ExtensionList data

Parameters:

  • node (Nokogiri::XML:Element)

    with ExtensionList data

Returns:



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

def parse(node)
  node.xpath('*').each do |column_node|
    case column_node.name
    when 'ext'
      @extension_array << Extension.new(parent: self).parse(column_node)
    end
  end
  self
end