aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/any_method.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/any_method.rb')
-rw-r--r--lib/rdoc/any_method.rb29
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
##