class OoxmlParser::Table
Class for Table
data
Attributes
Public Class Methods
Source
# File lib/ooxml_parser/common_parser/common_data/table.rb, line 13 def initialize(rows = [], parent: nil) @rows = rows super(parent: parent) end
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/common_parser/common_data/table.rb, line 26 def inspect to_s end
@return [String] inspect of object for debug means
Source
# File lib/ooxml_parser/common_parser/common_data/table.rb, line 33 def parse(node, number = 0, default_table_properties = TableProperties.new) table_properties = default_table_properties.dup table_properties.jc = :left node.xpath('*').each do |node_child| case node_child.name when 'tblGrid' @grid = TableGrid.new(parent: self).parse(node_child) when 'tr' @rows << TableRow.new(parent: self).parse(node_child) when 'tblPr' @properties = TableProperties.new(parent: self).parse(node_child) end end @number = number self end
Parse Table
object @param node [Nokogiri::XML:Element] node to parse @return [Table] result of parsing
Source
# File lib/ooxml_parser/common_parser/common_data/table.rb, line 21 def to_s "Rows: #{@rows.join(',')}" end
@return [String] result of convert of object to string