Class: OoxmlParser::TableStyleProperties
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::TableStyleProperties
- Defined in:
- lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb
Overview
Class for parsing ‘w:tblStylePr`
Instance Attribute Summary collapse
-
#paragraph_properties ⇒ ParagraphProperties
Properties of paragraph.
-
#run_properties ⇒ RunProperties
Properties of run.
-
#table_cell_properties ⇒ CellProperties
(also: #cell_properties)
Properties of table cell.
-
#table_properties ⇒ TableProperties
Properties of table.
-
#table_row_properties ⇒ TableRowProperties
readonly
Properties of table row.
-
#type ⇒ Symbol
Type of Table Style Properties.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(type: nil, parent: nil) ⇒ TableStyleProperties
constructor
A new instance of TableStyleProperties.
-
#parse(node) ⇒ TableStyleProperties
Parse table style property.
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(type: nil, parent: nil) ⇒ TableStyleProperties
Returns a new instance of TableStyleProperties.
22 23 24 25 26 27 |
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb', line 22 def initialize(type: nil, parent: nil) @type = type @run_properties = nil @table_cell_properties = CellProperties.new super(parent: parent) end |
Instance Attribute Details
#paragraph_properties ⇒ ParagraphProperties
Returns properties of paragraph.
18 19 20 |
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb', line 18 def paragraph_properties @paragraph_properties end |
#run_properties ⇒ RunProperties
Returns properties of run.
10 11 12 |
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb', line 10 def run_properties @run_properties end |
#table_cell_properties ⇒ CellProperties Also known as: cell_properties
Returns properties of table cell.
12 13 14 |
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb', line 12 def table_cell_properties @table_cell_properties end |
#table_properties ⇒ TableProperties
Returns properties of table.
14 15 16 |
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb', line 14 def table_properties @table_properties end |
#table_row_properties ⇒ TableRowProperties (readonly)
Returns properties of table row.
16 17 18 |
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb', line 16 def table_row_properties @table_row_properties end |
#type ⇒ Symbol
Returns type of Table Style Properties.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb', line 8 def type @type end |
Instance Method Details
#parse(node) ⇒ TableStyleProperties
Parse table style property
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb', line 32 def parse(node) node.attributes.each do |key, value| case key when 'type' @type = value.value.to_sym end end node.xpath('*').each do |node_child| case node_child.name when 'rPr' @run_properties = RunProperties.new(parent: self).parse(node_child) when 'tcPr' @table_cell_properties = CellProperties.new(parent: self).parse(node_child) when 'tblPr' @table_properties = TableProperties.new(parent: self).parse(node_child) when 'trPr' @table_row_properties = TableRowProperties.new(parent: self).parse(node_child) when 'pPr' @paragraph_properties = ParagraphProperties.new(parent: self).parse(node_child) end end self end |