Represent an alias, which is an old_name/new_name pair associated with a particular context
AttributesIs this an alias declared in a singleton context?
Public Class Methods Sourcedef 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
Creates a new Alias
with a token stream of text
that aliases old_name
to new_name
, has comment
and is a singleton
context.
def <=>(other) [@singleton ? 0 : 1, new_name] <=> [other.singleton ? 0 : 1, other.new_name] end
Order by singleton
then new_name
def aref type = singleton ? 'c' : 'i' "#alias-#{type}-#{html_name}" end
HTML fragment reference for this alias
Sourcedef html_name CGI.escape(@new_name.gsub('-', '-2D')).gsub('%', '-').sub(/^-/, '') end
HTML id-friendly version of new_name
.
def name_prefix singleton ? '::' : '#' end
‘::’ for the alias of a singleton method/attribute, ‘#’ for instance-level.
Sourcedef pretty_new_name "#{singleton ? '::' : '#'}#{@new_name}" end
New name with prefix ‘::’ or ‘#’.
Sourcedef pretty_old_name "#{singleton ? '::' : '#'}#{@old_name}" end
Old name with prefix ‘::’ or ‘#’.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4