Class: OoxmlParser::ExcelComments
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::ExcelComments
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/worksheet/excel_comments.rb
Overview
All Comments of single XLSX
Instance Attribute Summary collapse
-
#authors ⇒ Object
Returns the value of attribute authors.
-
#comment_list ⇒ CommentList
readonly
List of comments.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#comments ⇒ Array<ExcelComment>
List of comments.
-
#initialize(parent: nil) ⇒ ExcelComments
constructor
A new instance of ExcelComments.
-
#parse(file) ⇒ ExcelComments
Parse file with ExcelComments.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ ExcelComments
Returns a new instance of ExcelComments.
13 14 15 16 17 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/excel_comments.rb', line 13 def initialize(parent: nil) @authors = [] @comment_list = [] super end |
Instance Attribute Details
#authors ⇒ Object
Returns the value of attribute authors.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/excel_comments.rb', line 9 def @authors end |
#comment_list ⇒ CommentList (readonly)
Returns list of comments.
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/excel_comments.rb', line 11 def comment_list @comment_list end |
Instance Method Details
#comments ⇒ Array<ExcelComment>
Returns list of comments.
20 21 22 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/excel_comments.rb', line 20 def comments comment_list.comments end |
#parse(file) ⇒ ExcelComments
Parse file with ExcelComments
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/ooxml_parser/xlsx_parser/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 |