class OoxmlParser::CommentAuthors
Class for parsing ‘commentAuthors.xml` file
Attributes
@return [Array<CommentAuthor>] list of comment authors
Public Class Methods
Source
# File lib/ooxml_parser/pptx_parser/presentation/comment_authors.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/comment_authors.rb, line 18 def parse(file = "#{root_object.unpacked_folder}/#{root_object.root_subfolder}/commentAuthors.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 'cmAuthor' @list << CommentAuthor.new(parent: self).parse(node_child) end end self end
Parse CommentAuthors
object @param file [Nokogiri::XML:Element] node to parse @return [CommentAuthors] result of parsing