method
list_methods_matching
v1_9_3_125 -
Show latest stable
- Class:
RDoc::RI::Driver
list_methods_matching(name)public
Returns an Array of methods matching name
# File lib/rdoc/ri/driver.rb, line 940
def list_methods_matching name
found = []
find_methods name do |store, klass, ancestor, types, method|
if types == :instance or types == :both then
methods = store.instance_methods[ancestor]
if methods then
matches = methods.grep(/^#{Regexp.escape method.to_s}/)
matches = matches.map do |match|
"#{klass}##{match}"
end
found.push(*matches)
end
end
if types == :class or types == :both then
methods = store.class_methods[ancestor]
next unless methods
matches = methods.grep(/^#{Regexp.escape method.to_s}/)
matches = matches.map do |match|
"#{klass}::#{match}"
end
found.push(*matches)
end
end
found.uniq
end Related methods
- Instance methods
- add_also_in
- add_class
- add_from
- add_includes
- add_method_list
- ancestors_of
- class_cache
- class_document
- classes
- classes_and_includes_for
- complete
- display
- display_class
- display_method
- display_name
- display_names
- expand_class
- expand_name
- filter_methods
- find_methods
- formatter
- in_path?
- interactive
- list_known_classes
- list_methods_matching
- load_method
- load_methods_matching
- method_document
- method_type
- name_regexp
- page
- paging?
- parse_name
- run
- setup_pager
- Class methods
- default_options
- dump
- new
- process_args
- run