Sha256: 97ab0d1f9c35280ab21985b46ca0bbecb9bd90c7998b4ac68921ace62d1683d4
Contents?: true
Size: 1.63 KB
Versions: 1
Compression:
Stored size: 1.63 KB
Contents
require_relative 'table_style_properties/table_style_properties_helper' module OoxmlParser # Class for parsing `w:tblStylePr` class TableStyleProperties < OOXMLDocumentObject # @return [Symbol] type of Table Style Properties attr_accessor :type # @return [RunProperties] properties of run attr_accessor :run_properties # @return [CellProperties] properties of table cell attr_accessor :table_cell_properties # @return [TableProperties] properties of table attr_accessor :table_properties # @return [ParagraphProperties] properties of paragraph attr_accessor :paragraph_properties alias cell_properties table_cell_properties def initialize(type: nil, parent: nil) @type = type @run_properties = nil @table_cell_properties = CellProperties.new @parent = parent end # Parse table style property # @param node [Nokogiri::XML::Element] node to parse # @return [TableStyleProperties] 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 'pPr' @paragraph_properties = ParagraphProperties.new(parent: self).parse(node_child) end end self end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ooxml_parser-0.2.0 | lib/ooxml_parser/common_parser/common_data/table/properties/table_style_properties.rb |