Class: OoxmlParser::TableRowProperties

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb

Overview

Class for describing Table Row Properties

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

#cells_spacingOoxmlSize

Returns Table cell spacing.

Returns:



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

def cells_spacing
  @cells_spacing
end

#heightTableRowHeight

Returns Table Row Height.

Returns:



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

def height
  @height
end

#table_headerTrue, False

Specifies that the current row should be repeated at the top each new page on which the table is displayed. >ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference 17.4.50

Returns:

  • (True, False)


15
16
17
# File 'lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb', line 15

def table_header
  @table_header
end

Instance Method Details

#parse(node) ⇒ TableRowProperties

Parse Columns data

Parameters:

  • node (Nokogiri::XML:Element)

    with Table Row Properties data

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/ooxml_parser/common_parser/common_data/table/row/row/table_row_properties.rb', line 20

def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'trHeight'
      @height = TableRowHeight.new(parent: self).parse(node_child)
    when 'tblCellSpacing'
      @cells_spacing = OoxmlSize.new.parse(node_child)
    when 'tblHeader'
      @table_header = option_enabled?(node_child)
    end
  end
  self
end