class OoxmlParser::CommentAuthors
Class for parsing ‘commentAuthors.xml` file
Attributes
list[R]
@return [Array<CommentAuthor>] list of comment authors
Public Class Methods
new(parent: nil)
click to toggle source
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
# File lib/ooxml_parser/pptx_parser/presentation/comment_authors.rb, line 10 def initialize(parent: nil) @list = [] super end
Public Instance Methods
parse(file = "
click to toggle source
Parse CommentAuthors
object @param file [Nokogiri::XML:Element] node to parse @return [CommentAuthors] result of parsing
# 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