Class: OoxmlParser::TableLayout

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb

Overview

Class for parsing ‘w:tblLayout` object Whether a table uses a fixed width or autofit method for laying out the table contents is specified with the <w:tblLayout> element within the <w:tblPr> element. If <w:tblLayout> is omitted, autofit is assumed.

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, #initialize, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#typeSymbol

Returns Specifies the method of laying out the contents of the table.

Returns:

  • (Symbol)

    Specifies the method of laying out the contents of the table



8
9
10
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb', line 8

def type
  @type
end

Instance Method Details

#parse(node) ⇒ TableLayout

Parse TableLayout

Parameters:

  • node (Nokogiri::XML:Node)

    with TableLayout

Returns:



13
14
15
16
17
18
19
20
21
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_layout.rb', line 13

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'type'
      @type = value.value.to_sym
    end
  end
  self
end