in lib/rdoc/method_attr.rb [177:198]
def find_method_or_attribute name
return nil unless parent.respond_to? :ancestors
searched = parent.ancestors
kernel = @store.modules_hash['Kernel']
searched << kernel if kernel &&
parent != kernel && !searched.include?(kernel)
searched.each do |ancestor|
next if String === ancestor
next if parent == ancestor
other = ancestor.find_method_named('#' + name) ||
ancestor.find_attribute_named(name)
return other if other
end
nil
end