Class: OoxmlParser::PresentationComment
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::PresentationComment
- Defined in:
- lib/ooxml_parser/pptx_parser/presentation/presentation_comments/presentation_comment.rb
Overview
Class for parsing ‘p:cm` tag
Instance Attribute Summary collapse
-
#author_id ⇒ Integer
readonly
Id of author.
-
#position ⇒ OOXMLCoordinates
readonly
Position of comment.
-
#text ⇒ String
readonly
Text of comment.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#author ⇒ CommentAuthor
Author of comment.
-
#parse(node) ⇒ PresentationComment
Parse PresentationComment object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#author_id ⇒ Integer (readonly)
Returns id of author.
7 8 9 |
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_comments/presentation_comment.rb', line 7 def @author_id end |
#position ⇒ OOXMLCoordinates (readonly)
Returns position of comment.
9 10 11 |
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_comments/presentation_comment.rb', line 9 def position @position end |
#text ⇒ String (readonly)
Returns text of comment.
11 12 13 |
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_comments/presentation_comment.rb', line 11 def text @text end |
Instance Method Details
#author ⇒ CommentAuthor
Returns author of comment.
14 15 16 |
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_comments/presentation_comment.rb', line 14 def root_object..(@author_id) end |
#parse(node) ⇒ PresentationComment
Parse PresentationComment object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ooxml_parser/pptx_parser/presentation/presentation_comments/presentation_comment.rb', line 21 def parse(node) node.attributes.each do |key, value| case key when 'authorId' @author_id = value.value.to_i end end node.xpath('*').each do |node_child| case node_child.name when 'pos' @position = OOXMLCoordinates.new(parent: self).parse(node_child) when 'text' @text = node_child.text.to_s end end self end |