Sha256: 85bc2c46452207955a8ca095716f8f86f2c6ab547aae706da4ee7d8c43e56e50
Contents?: true
Size: 721 Bytes
Versions: 8
Compression:
Stored size: 721 Bytes
Contents
# frozen_string_literal: true module OoxmlParser # Class for parsing `txBody` tags class TextBody < OOXMLDocumentObject attr_accessor :properties, :paragraphs def initialize(parent: nil) @paragraphs = [] @parent = parent end # Parse TextBody object # @param node [Nokogiri::XML:Element] node to parse # @return [TextBody] result of parsing def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'p' @paragraphs << Paragraph.new(parent: self).parse(node_child) when 'bodyPr' @properties = OOXMLShapeBodyProperties.new(parent: self).parse(node_child) end end self end end end
Version data entries
8 entries across 8 versions & 1 rubygems