Yields items matching name including the store they were found in,
the class being searched for, the class they were found in (an ancestor)
the types of methods to look up (from #method_type), and the method
name being searched for
# File lib/rdoc/ri/driver.rb, line 803
def find_methods name
klass, selector, method = parse_name name
types = method_type selector
klasses = nil
ambiguous = klass.empty?
if ambiguous then
klasses = classes.keys
else
klasses = ancestors_of klass
klasses.unshift klass
end
methods = []
klasses.each do |ancestor|
ancestors = classes[ancestor]
next unless ancestors
klass = ancestor if ambiguous
ancestors.each do |store|
methods << [store, klass, ancestor, types, method]
end
end
methods = methods.sort_by do |_, k, a, _, m|
[k, a, m].compact
end
methods.each do |item|
yield(*item) # :yields: store, klass, ancestor, types, method
end
self
end