class OoxmlParser::PresentationComments
Class for parsing ‘comment1.xml` file
Attributes
@return [Array<PresentationComment>] list of comments
Public Class Methods
Source
# File lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb, line 10 def initialize(parent: nil) @list = [] super end
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/pptx_parser/presentation/presentation_comments.rb, line 18 def parse(file = "#{root_object.unpacked_folder}/#{root_object.root_subfolder}/comments/comment1.xml") return nil unless File.exist?(file) document = parse_xml(file) node = document.xpath('*').first node.xpath('*').each do |node_child| case node_child.name when 'cm' @list << PresentationComment.new(parent: self).parse(node_child) end end self end
Parse PresentationComments
object @param file [Nokogiri::XML:Element] node to parse @return [PresentationComments] result of parsing