diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-14 00:39:16 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-14 00:39:16 +0000 |
commit | 0b6da24a5e24ff9ce8e153d2f073c2363e94b28e (patch) | |
tree | 95eb233fee15aae2fa2ba7dbeb1bb9c7bdfd9e1d /lib/rdoc/class_module.rb | |
parent | fe89874540f5e95fbfd933a72fff2ad31b8e8d07 (diff) | |
download | ruby-0b6da24a5e24ff9ce8e153d2f073c2363e94b28e.tar.gz |
* 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
Diffstat (limited to 'lib/rdoc/class_module.rb')
-rw-r--r-- | lib/rdoc/class_module.rb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/rdoc/class_module.rb b/lib/rdoc/class_module.rb index 3f2d04488e..89441b3e68 100644 --- a/lib/rdoc/class_module.rb +++ b/lib/rdoc/class_module.rb @@ -138,11 +138,21 @@ class RDoc::ClassModule < RDoc::Context end ## + # Iterates the ancestors of this class or module for which an + # RDoc::ClassModule exists. + + def each_ancestor # :yields: module + ancestors.each do |mod| + next if String === mod + yield mod + end + end + + ## # Looks for a symbol in the #ancestors. See Context#find_local_symbol. def find_ancestor_local_symbol symbol - ancestors.each do |m| - next if m.is_a?(String) + each_ancestor do |m| res = m.find_local_symbol(symbol) return res if res end @@ -263,7 +273,7 @@ class RDoc::ClassModule < RDoc::Context class_module.each_attribute do |attr| if match = attributes.find { |a| a.name == attr.name } then - match.rw = [match.rw, attr.rw].compact.join + match.rw = [match.rw, attr.rw].compact.uniq.join else add_attribute attr end |