Adds comment to this ClassModule’s list of comments at
location. This method is preferred over #comment= since it allows ri
data to be updated across multiple runs.
# File lib/rdoc/class_module.rb, line 127
def add_comment comment, location
return unless document_self
original = comment
comment = case comment
when RDoc::Comment then
comment.normalize
else
normalize_comment comment
end
if location.parser == RDoc::Parser::C
@comment_location.delete_if { |(_, l)| l == location }
end
@comment_location << [comment, location]
self.comment = original
end