diff options
Diffstat (limited to 'lib/rdoc/context.rb')
-rw-r--r-- | lib/rdoc/context.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/rdoc/context.rb b/lib/rdoc/context.rb index 3f2856db05..0d7fc41529 100644 --- a/lib/rdoc/context.rb +++ b/lib/rdoc/context.rb @@ -480,7 +480,7 @@ class RDoc::Context < RDoc::CodeObject # Adds included module +include+ which should be an RDoc::Include def add_include(include) - add_to @includes, include + add_to @includes, include unless @includes.map { |i| i.full_name }.include?( include.full_name ) end ## @@ -950,10 +950,14 @@ class RDoc::Context < RDoc::CodeObject ## # Yields AnyMethod and Attr entries matching the list of names in +methods+. - def methods_matching(methods, singleton = false) + def methods_matching(methods, singleton = false, &block) (@method_list + @attributes).each do |m| yield m if methods.include?(m.name) and m.singleton == singleton end + + each_ancestor do |parent| + parent.methods_matching(methods, singleton, &block) + end end ## @@ -1021,11 +1025,19 @@ class RDoc::Context < RDoc::CodeObject remove_invisible_in @attributes, min_visibility end + ## + # Only called when min_visibility == :public or :private + def remove_invisible_in(array, min_visibility) # :nodoc: if min_visibility == :public - array.reject! { |e| e.visibility != :public } + array.reject! { |e| + e.visibility != :public and not e.force_documentation + } else - array.reject! { |e| e.visibility == :private } + array.reject! { |e| + e.visibility == :private and + not e.force_documentation + } end end |