add_method(method)
public
Adds method if not already there. If it is (as method or
attribute), updates the comment if it was empty.
Show source
def add_method method
return method unless @document_self
key = method.pretty_name
known = @methods_hash[key]
if known then
if @store then
known.comment = method.comment if known.comment.empty?
previously = ", previously in #{known.file}" unless
method.file == known.file
@store.rdoc.options.warn "Duplicate method #{known.full_name} in #{method.file}#{previously}"
end
else
@methods_hash[key] = method
method.visibility = @visibility
add_to @method_list, method
resolve_aliases method
end
method
end