Method: Axlsx::Comment#to_xml_string
- Defined in:
- lib/axlsx/workbook/worksheet/comment.rb
#to_xml_string(str = "") ⇒ String
serialize the object
62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/axlsx/workbook/worksheet/comment.rb', line 62 def to_xml_string(str = "") = @comments.[] str << ('<comment ref="' << ref << '" authorId="' << .to_s << '">') str << '<text>' unless .to_s == "" str << '<r><rPr><b/><color indexed="81"/></rPr>' str << ("<t>" << ::CGI.escapeHTML(.to_s) << ":\n</t></r>") end str << '<r>' str << '<rPr><color indexed="81"/></rPr>' str << ('<t>' << ::CGI.escapeHTML(text) << '</t></r></text>') str << '</comment>' end |