diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-19 05:08:28 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-19 05:08:28 +0000 |
commit | 75ef9e79d6f872d9155cfa69d717b0c693be7fc9 (patch) | |
tree | 97fa40e34793b267292d9d769150292a43f3838e /lib/rdoc/any_method.rb | |
parent | 37e59f5583c781e98f41608251e094377237a133 (diff) | |
download | ruby-75ef9e79d6f872d9155cfa69d717b0c693be7fc9.tar.gz |
Import RDoc 2.5.4
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/any_method.rb')
-rw-r--r-- | lib/rdoc/any_method.rb | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/lib/rdoc/any_method.rb b/lib/rdoc/any_method.rb index f3f83363cd..db59403e22 100644 --- a/lib/rdoc/any_method.rb +++ b/lib/rdoc/any_method.rb @@ -46,11 +46,6 @@ class RDoc::AnyMethod < RDoc::CodeObject attr_reader :aliases ## - # Fragment reference for this method - - attr_reader :aref - - ## # The method we're aliasing attr_accessor :is_alias_for @@ -67,21 +62,13 @@ class RDoc::AnyMethod < RDoc::CodeObject include RDoc::TokenStream - ## - # Resets method fragment reference counter - - def self.reset - @@aref = 'M000000' - end - - reset - def initialize(text, name) super() @text = text @name = name + @aref = nil @aliases = [] @block_params = nil @call_seq = nil @@ -92,9 +79,6 @@ class RDoc::AnyMethod < RDoc::CodeObject @singleton = nil @token_stream = nil @visibility = :public - - @aref = @@aref - @@aref = @@aref.succ end ## @@ -112,6 +96,15 @@ class RDoc::AnyMethod < RDoc::CodeObject end ## + # HTML fragment reference for this method + + def aref + type = singleton ? 'c' : 'i' + + "method-#{type}-#{CGI.escape name}" + end + + ## # The call_seq or the param_seq with method name, if there is no call_seq. # # Use this for displaying a method's argument lists. @@ -248,7 +241,7 @@ class RDoc::AnyMethod < RDoc::CodeObject # Path to this method def path - "#{@parent.path}##{@aref}" + "#{@parent.path}##{aref}" end ## |