From 0b6da24a5e24ff9ce8e153d2f073c2363e94b28e Mon Sep 17 00:00:00 2001 From: drbrain Date: Sat, 14 May 2011 00:39:16 +0000 Subject: * lib/rdoc.rb: Updated to RDoc 3.6 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/code_object.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/rdoc/code_object.rb') diff --git a/lib/rdoc/code_object.rb b/lib/rdoc/code_object.rb index 3a8adfab67..63f86afc64 100644 --- a/lib/rdoc/code_object.rb +++ b/lib/rdoc/code_object.rb @@ -180,6 +180,20 @@ class RDoc::CodeObject @document_children = @document_self end + ## + # Yields each parent of this CodeObject. See also + # RDoc::ClassModule#each_ancestor + + def each_parent + code_object = self + + while code_object = code_object.parent do + yield code_object + end + + self + end + ## # Force the documentation of this object unless documentation # has been turned off by :endoc: -- cgit v1.2.3