class Roo::Excelx::Comments

Public Instance Methods

comments() click to toggle source
# File lib/roo/excelx/comments.rb, line 6
def comments
  @comments ||= extract_comments
end

Private Instance Methods

extract_comments() click to toggle source
# File lib/roo/excelx/comments.rb, line 12
def extract_comments
  if doc_exists?
    Hash[doc.xpath("//comments/commentList/comment").map do |comment|
      value = (comment.at_xpath('./text/r/t') || comment.at_xpath('./text/t')).text
      [::Roo::Utils.ref_to_key(comment.attributes['ref'].to_s), value]
    end]
  else
    {}
  end
end