Class: OoxmlParser::PresentationCommentAuthor
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::PresentationCommentAuthor
- Defined in:
- lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment/presentation_comment_author.rb
Constant Summary
Constants inherited from OOXMLDocumentObject
OOXMLDocumentObject::DEFAULT_DIRECTORY_FOR_MEDIA
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#initials ⇒ Object
Returns the value of attribute initials.
-
#name ⇒ Object
Returns the value of attribute name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(id, name, initials) ⇒ PresentationCommentAuthor
constructor
A new instance of PresentationCommentAuthor.
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(id, name, initials) ⇒ PresentationCommentAuthor
Returns a new instance of PresentationCommentAuthor.
5 6 7 8 9 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment/presentation_comment_author.rb', line 5 def initialize(id, name, initials) @id = id @name = name @initials = initials end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment/presentation_comment_author.rb', line 3 def id @id end |
#initials ⇒ Object
Returns the value of attribute initials.
3 4 5 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment/presentation_comment_author.rb', line 3 def initials @initials end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment/presentation_comment_author.rb', line 3 def name @name end |
Class Method Details
.parse ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ooxml_parser/pptx_parser/pptx_data/presentation/presentation_comment/presentation_comment_author.rb', line 11 def self.parse = {} begin doc = Nokogiri::XML(File.open(OOXMLDocumentObject.path_to_folder + 'ppt/commentAuthors.xml')) rescue StandardError raise "Can't find commentAuthors.xml in #{OOXMLDocumentObject.path_to_folder}/ppt folder" end doc.xpath('p:cmAuthorLst/p:cmAuthor').each do || [.attribute('id').value] = PresentationCommentAuthor.new( .attribute('id').value, .attribute('name').value, .attribute('initials').value ) end end |