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

#==, #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

#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



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

def type
  @type
end

Instance Method Details

#parse(node) ⇒ TableLayout

Parse TableLayout

Parameters:

  • node (Nokogiri::XML:Node)

    with TableLayout

Returns:



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

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