Class: OoxmlParser::ExcelCommentCharacter

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(properties = nil, text = '') ⇒ ExcelCommentCharacter

Returns a new instance of ExcelCommentCharacter.



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

def initialize(properties = nil, text = '')
  @properties = properties
  @text = text
end

Instance Attribute Details

#propertiesObject

Returns the value of attribute properties.



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

def properties
  @properties
end

#textObject

Returns the value of attribute text.



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

def text
  @text
end

Class Method Details

.parse(character_node) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/excel_comments/excel_comment/excel_comment_character.rb', line 12

def self.parse(character_node)
  character = ExcelCommentCharacter.new
  character_node.xpath('*').each do |character_node_child|
    case character_node_child.name
    when 'rPr'
      character.properties = ExcelCommentCharacterProperties.parse(character_node_child)
    when 't'
      character.text = character_node_child.text
    end
  end
  character
end