class OoxmlParser::Paragraph
Class for parsing ‘p` tags
Attributes
@return [AlternateContent] alternate content data
Public Class Methods
Source
# File lib/ooxml_parser/common_parser/common_data/paragraph.rb, line 13 def initialize(runs = [], formulas = [], parent: nil) @runs = runs @formulas = formulas @runs = [] super(parent: parent) end
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/common_parser/common_data/paragraph.rb, line 30 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'pPr' @properties = ParagraphProperties.new(parent: self).parse(node_child) when 'fld' @text_field = TextField.new(parent: self).parse(node_child) when 'r' @runs << ParagraphRun.new(parent: self).parse(node_child) when 'AlternateContent' @alternate_content = AlternateContent.new(parent: self).parse(node_child) end end self end
Parse Paragraph
object @param node [Nokogiri::XML:Element] node to parse @return [Paragraph] result of parsing