Class: OoxmlParser::ExtensionList

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/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

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

#initialize(parent: nil) ⇒ ExtensionList

Returns a new instance of ExtensionList.



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

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

Instance Attribute Details

#extension_arrayObject

Returns the value of attribute extension_array.



5
6
7
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb', line 5

def extension_array
  @extension_array
end

Instance Method Details

#[](key) ⇒ Array, Extension

Returns accessor.

Returns:



13
14
15
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb', line 13

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

#parse(node) ⇒ ExtensionList

Parse ExtensionList data

Parameters:

  • node (Nokogiri::XML:Element)

    with ExtensionList data

Returns:



20
21
22
23
24
25
26
27
28
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/table_part/extension_list.rb', line 20

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