Class: OoxmlParser::ExcelComment

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb

Constant Summary

Constants inherited from OOXMLDocumentObject

OOXMLDocumentObject::DEFAULT_DIRECTORY_FOR_MEDIA

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, copy_media_file, current_xml, dir, encrypted_file?, get_link_from_rels, media_folder, option_enabled?, unzip_file

Constructor Details

#initialize(characters = []) ⇒ ExcelComment

Returns a new instance of ExcelComment.



7
8
9
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb', line 7

def initialize(characters = [])
  @characters = characters
end

Instance Attribute Details

#charactersObject

Returns the value of attribute characters.



5
6
7
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb', line 5

def characters
  @characters
end

Class Method Details

.parse(comment_node) ⇒ Object



11
12
13
14
15
16
17
18
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment.rb', line 11

def self.parse(comment_node)
  comment = ExcelComment.new
  comment_node.xpath('xmlns:text/xmlns:r').each do |character_node|
    character = ExcelCommentCharacter.parse(character_node)
    comment.characters << character.dup
  end
  comment
end