Represent an alias, which is an old_name/new_name pair associated with a particular context
- #
- A
- F
- H
- N
- P
| [R] | name | Aliased method's name |
| [R] | new_name | Aliased method's name |
| [R] | old_name | Aliasee method's name |
| [RW] | singleton | Is this an alias declared in a singleton context? |
| [R] | text | Source file token stream |
Creates a new Alias with a token stream of
text that aliases old_name to
new_name, has comment and is a
singleton context.
Source: show
# File lib/rdoc/alias.rb, line 36 def initialize(text, old_name, new_name, comment, singleton = false) super() @text = text @singleton = singleton @old_name = old_name @new_name = new_name self.comment = comment end
Source: show
# File lib/rdoc/alias.rb, line 49 def <=>(other) [@singleton ? 0 : 1, new_name] <=> [other.singleton ? 0 : 1, other.new_name] end
HTML fragment reference for this alias
Source: show
# File lib/rdoc/alias.rb, line 56 def aref type = singleton ? 'c' : 'i' "#alias-#{type}-#{html_name}" end
Full old name including namespace
Source: show
# File lib/rdoc/alias.rb, line 64 def full_old_name @full_name || "#{parent.name}#{pretty_old_name}" end
HTML id-friendly version of #new_name.
Source: show
# File lib/rdoc/alias.rb, line 71 def html_name CGI.escape(@new_name.gsub('-', '-2D')).gsub('%','-').sub(/^-/, '') end
'::' for the alias of a singleton method/attribute, '#' for instance-level.
Source: show
# File lib/rdoc/alias.rb, line 86 def name_prefix singleton ? '::' : '#' end
New name with prefix '::' or '#'.
Source: show
# File lib/rdoc/alias.rb, line 100 def pretty_new_name "#{singleton ? '::' : '#'}#{@new_name}" end