Class: OoxmlParser::PresentationComment
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::PresentationComment
- Defined in:
- lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#position ⇒ Object
Returns the value of attribute position.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from OOXMLDocumentObject
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(author) ⇒ PresentationComment
constructor
A new instance of PresentationComment.
Methods inherited from OOXMLDocumentObject
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(author) ⇒ PresentationComment
Returns a new instance of PresentationComment.
6 7 8 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb', line 6 def initialize() @author = end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
4 5 6 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb', line 4 def @author end |
#position ⇒ Object
Returns the value of attribute position.
4 5 6 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb', line 4 def position @position end |
#text ⇒ Object
Returns the value of attribute text.
4 5 6 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb', line 4 def text @text end |
Class Method Details
.parse(comment_node, comment_authors) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb', line 10 def self.parse(comment_node, ) comment = PresentationComment.new([comment_node.attribute('authorId').value]) comment_node.xpath('*').each do |comment_node_child| case comment_node_child.name when 'pos' comment.position = OOXMLCoordinates.parse(comment_node_child, x_attr: 'x', y_attr: 'y') when 'text' comment.text = comment_node_child.text.to_s end end comment end |
.parse_list ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment.rb', line 23 def self.parse_list File.exist?(OOXMLDocumentObject.path_to_folder + 'ppt/comments/comment1.xml') ? doc = Nokogiri::XML(File.open(OOXMLDocumentObject.path_to_folder + '/ppt/comments/comment1.xml')) : (return []) = PresentationCommentAuthor.parse comments = [] doc.xpath('p:cmLst/p:cm').each { |comment_node| comments << PresentationComment.parse(comment_node, ) } comments end |