class OoxmlParser::Comment
Comment
Data
Attributes
@return [String] date of the comment, in string, not parsed
@return [Integer] id of comment
@return [String] initials of the author
@return [Array<DocxParagraph>] array of paragraphs
Public Class Methods
Source
# File lib/ooxml_parser/docx_parser/document_structure/comments/comment.rb, line 17 def initialize(id = nil, paragraphs = [], parent: nil) @id = id @paragraphs = paragraphs super(parent: parent) end
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/docx_parser/document_structure/comments/comment.rb, line 26 def parse(node) node.attributes.each do |key, value| case key when 'author' @author = value.value.to_s when 'date' @date_string = value.value.to_s when 'id' @id = value.value.to_i when 'initials' @initials = value.value.to_s end end node.xpath('*').each do |node_child| case node_child.name when 'p' @paragraphs << DocxParagraph.new.parse(node_child, 0, parent: self) end end self end
Parse Comment
object @param node [Nokogiri::XML:Element] node to parse @return [Comment] result of parsing