diff options
Diffstat (limited to 'lib/rdoc/ri/ri_reader.rb')
-rw-r--r-- | lib/rdoc/ri/ri_reader.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/rdoc/ri/ri_reader.rb b/lib/rdoc/ri/ri_reader.rb index dd647b3f89..ddce38f101 100644 --- a/lib/rdoc/ri/ri_reader.rb +++ b/lib/rdoc/ri/ri_reader.rb @@ -52,5 +52,19 @@ module RI File.open(path) {|f| RI::Description.deserialize(f) } end + # return the names of all classes and modules + def class_names + res = [] + find_classes_in(res, @cache.toplevel) + end + + def find_classes_in(res, klass) + classes = klass.classes_and_modules + for c in classes + res << c.name + find_classes_in(res, c) + end + res + end end end |