Return a list of all classes, modules, and methods
# File rdoc/ri/reader.rb, line 79
def all_names
res = []
find_names_in(res, @cache.toplevel)
end
# File rdoc/ri/reader.rb, line 24
def find_class_by_name(full_name)
names = full_name.split(/::/)
ns = @cache.toplevel
for name in names
ns = ns.contained_class_named(name)
return nil if ns.nil?
end
get_class(ns)
end
# File rdoc/ri/reader.rb, line 34
def find_methods(name, is_class_method, namespaces)
result = []
namespaces.each do |ns|
result.concat ns.methods_matching(name, is_class_method)
end
result
end
Return the names of all classes and modules
# File rdoc/ri/reader.rb, line 71
def full_class_names
res = []
find_classes_in(res, @cache.toplevel)
end
Return a class description
# File rdoc/ri/reader.rb, line 54
def get_class(class_entry)
result = nil
for path in class_entry.path_names
path = RDoc::RI::Writer.class_desc_path(path, class_entry)
desc = File.open(path) {|f| RDoc::RI::Description.deserialize(f) }
if result
result.merge_in(desc)
else
result = desc
end
end
result
end
Return the MethodDescription for a given MethodEntry by deserializing the YAML
# File rdoc/ri/reader.rb, line 46
def get_method(method_entry)
path = method_entry.path_name
File.open(path) { |f| RDoc::RI::Description.deserialize(f) }
end
Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.
If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.
If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.
If you want to help improve the Ruby documentation, please see Improve the docs, or visit Documenting-ruby.org.