Sha256: f6263fa2c91c16ebdf44761bc80b262009710dca7cbd854e67d8a882db7b17da
Contents?: true
Size: 895 Bytes
Versions: 4
Compression:
Stored size: 895 Bytes
Contents
module OoxmlParser # Class for parsing `txbx` tags class OOXMLTextBox < OOXMLDocumentObject attr_accessor :properties, :elements def initialize(parent: nil) @elements = [] @parent = parent end # Parse OOXMLTextBox object # @param node [Nokogiri::XML:Element] node to parse # @return [OOXMLTextBox] result of parsing def parse(node) text_box_content_node = node.xpath('w:txbxContent').first text_box_content_node.xpath('*').each_with_index do |node_child, index| case node_child.name when 'p' @elements << DocxParagraph.new(parent: self).parse(node_child, index) when 'tbl' @elements << Table.new(parent: self).parse(node_child, index) when 'bodyPr' @properties = OOXMLShapeBodyProperties.new(parent: self).parse(node_child) end end self end end end
Version data entries
4 entries across 4 versions & 1 rubygems