Method deprecated or moved
This method is deprecated or moved on the latest stable version. The last existing version (v1_9_1_378) is shown here.
lookup_ancestor(klass, orig_klass)public
Finds the next ancestor of orig_klass after klass.
# File lib/rdoc/ri/driver.rb, line 513
def lookup_ancestor(klass, orig_klass)
# This is a bit hacky, but ri will go into an infinite
# loop otherwise, since Object has an Object ancestor
# for some reason. Depending on the documentation state, I've seen
# Kernel as an ancestor of Object and not as an ancestor of Object.
if ((orig_klass == "Object") &&
((klass == "Kernel") || (klass == "Object")))
return nil
end
cache = class_cache[orig_klass]
return nil unless cache
ancestors = [orig_klass]
ancestors.push(*cache.includes.map { |inc| inc['name'] })
ancestors << cache.superclass
ancestor_index = ancestors.index(klass)
if ancestor_index
ancestor = ancestors[ancestors.index(klass) + 1]
return ancestor if ancestor
end
lookup_ancestor klass, cache.superclass
end Related methods
- Instance methods
- cache_file_for
- cache_file_path
- class_cache
- class_cache_file_path
- create_cache_for
- create_class_cache
- display_class
- display_method
- get_info_for
- load_cache_for
- lookup_ancestor
- lookup_method
- map_dirs
- parse_name
- populate_class_cache
- read_yaml
- run
- select_methods
- write_cache
- Class methods
- default_options
- new
- process_args
- run