summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-26 12:42:01 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-04-26 12:42:01 +0000
commit04aa9a8f7df6577b710015f7dc78ccbc97e1e836 (patch)
treebcb75a52b26af439f5df568a32313973c81cf0aa /lib
parent269d1e9f0d305a6d7e750b2a8dd2657cb0e08501 (diff)
Alias alias to instance methods
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rdoc/code_objects.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/rdoc/code_objects.rb b/lib/rdoc/code_objects.rb
index a60affb7de..1d2e4d2129 100644
--- a/lib/rdoc/code_objects.rb
+++ b/lib/rdoc/code_objects.rb
@@ -195,7 +195,7 @@ module RDoc
end
def add_alias(an_alias)
- meth = find_method_named(an_alias.old_name)
+ meth = find_instance_method_named(an_alias.old_name)
if meth
new_meth = AnyMethod.new(an_alias.text, an_alias.new_name)
new_meth.is_alias_for = meth
@@ -380,6 +380,11 @@ module RDoc
@method_list.find {|meth| meth.name == name}
end
+ # Find a named instance method, or return nil
+ def find_instance_method_named(name)
+ @method_list.find {|meth| meth.name == name && !meth.singleton}
+ end
+
# Find a named constant, or return nil
def find_constant_named(name)
@constants.find {|m| m.name == name}