Class: OoxmlParser::TableRow
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::TableRow
- Defined in:
- lib/ooxml_parser/common_parser/common_data/table/row/row.rb
Overview
Class for data of TableRow
Instance Attribute Summary collapse
-
#cells ⇒ Object
Returns the value of attribute cells.
-
#height ⇒ Object
(also: #table_row_height)
Returns the value of attribute height.
-
#table_row_properties ⇒ Object
Returns the value of attribute table_row_properties.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(cells = [], parent: nil) ⇒ TableRow
constructor
A new instance of TableRow.
-
#parse(node) ⇒ TableRow
Parse TableRow object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(cells = [], parent: nil) ⇒ TableRow
Returns a new instance of TableRow.
10 11 12 13 |
# File 'lib/ooxml_parser/common_parser/common_data/table/row/row.rb', line 10 def initialize(cells = [], parent: nil) @cells = cells super(parent: parent) end |
Instance Attribute Details
#cells ⇒ Object
Returns the value of attribute cells.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/table/row/row.rb', line 8 def cells @cells end |
#height ⇒ Object Also known as: table_row_height
Returns the value of attribute height.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/table/row/row.rb', line 8 def height @height end |
#table_row_properties ⇒ Object
Returns the value of attribute table_row_properties.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/table/row/row.rb', line 8 def table_row_properties @table_row_properties end |
Instance Method Details
#parse(node) ⇒ TableRow
Parse TableRow object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ooxml_parser/common_parser/common_data/table/row/row.rb', line 20 def parse(node) root_object.default_font_style = FontStyle.new(true) # TODO: Add correct parsing of TableStyle.xml file and use it node.attributes.each do |key, value| case key when 'h' @height = OoxmlSize.new(value.value.to_f, :emu) end end node.xpath('*').each do |node_child| case node_child.name when 'trPr' @table_row_properties = TableRowProperties.new(parent: self).parse(node_child) when 'tc' @cells << TableCell.new(parent: self).parse(node_child) end end root_object.default_font_style = FontStyle.new self end |