1
require 'rdoc/code_object'
4
# Represent an alias, which is an old_name/new_name pair associated with a
7
class RDoc::Alias < RDoc::CodeObject
10
# Allow comments to be overridden
17
attr_accessor :new_name
22
attr_accessor :old_name
25
# Source file token stream
30
# Creates a new Alias with a token stream of +text+ that aliases +old_name+
31
# to +new_name+ and has +comment+
33
def initialize(text, old_name, new_name, comment)
38
self.comment = comment
42
parent_name = parent ? parent.name : '(unknown)'
43
"#<%s:0x%x %s.alias_method %s, %s>" % [
44
self.class, object_id,
45
parent_name, @old_name, @new_name,
50
"alias: #{self.old_name} -> #{self.new_name}\n#{self.comment}"