class OoxmlParser::ExcelComments
All Comments
of single XLSX
Attributes
comment_list[R]
@return [CommentList] list of comments
Public Class Methods
new(parent: nil)
click to toggle source
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
# File lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb, line 13 def initialize(parent: nil) @authors = [] @comment_list = [] super end
Public Instance Methods
comments()
click to toggle source
@return [Array<ExcelComment>] list of comments
# File lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb, line 20 def comments comment_list.comments end
parse(file)
click to toggle source
Parse file with ExcelComments
@param file [String] file to parse @return [ExcelComments] object with data
# File lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments.rb, line 30 def parse(file) doc = parse_xml(file) node = doc.xpath('*').first node.xpath('*').each do |node_child| case node_child.name when 'authors' @authors << Author.new(parent: self).parse(node_child) when 'commentList' @comment_list = CommentList.new(parent: self).parse(node_child) end end self end