Class: OoxmlParser::CommentAuthor

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/pptx_parser/presentation/comment_authors/comment_author.rb

Overview

Class for parsing ‘cmAuthor` tag

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#color_indexInteger (readonly)

Returns Comment Author Color Index.

Returns:

  • (Integer)

    Comment Author Color Index



15
16
17
# File 'lib/ooxml_parser/pptx_parser/presentation/comment_authors/comment_author.rb', line 15

def color_index
  @color_index
end

#idInteger (readonly)

Returns Comment Author ID.

Returns:

  • (Integer)

    Comment Author ID



7
8
9
# File 'lib/ooxml_parser/pptx_parser/presentation/comment_authors/comment_author.rb', line 7

def id
  @id
end

#initialsString (readonly)

Returns Author Initials.

Returns:

  • (String)

    Author Initials



11
12
13
# File 'lib/ooxml_parser/pptx_parser/presentation/comment_authors/comment_author.rb', line 11

def initials
  @initials
end

#last_indexInteger (readonly)

Returns Index of Comment Author’s last comment.

Returns:

  • (Integer)

    Index of Comment Author’s last comment



13
14
15
# File 'lib/ooxml_parser/pptx_parser/presentation/comment_authors/comment_author.rb', line 13

def last_index
  @last_index
end

#nameString (readonly)

Returns Author Name.

Returns:

  • (String)

    Author Name



9
10
11
# File 'lib/ooxml_parser/pptx_parser/presentation/comment_authors/comment_author.rb', line 9

def name
  @name
end

Instance Method Details

#parse(node) ⇒ CommentAuthor

Parse CommentAuthor object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/ooxml_parser/pptx_parser/presentation/comment_authors/comment_author.rb', line 20

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'id'
      @id = value.value.to_i
    when 'name'
      @name = value.value.to_s
    when 'initials'
      @initials = value.value.to_s
    when 'lastIdx'
      @last_index = value.value.to_i
    when 'clrIdx'
      @color_index = value.value.to_i
    end
  end
  self
end