A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://ruby.github.io/rdoc/RDoc/Alias.html below:

class RDoc::Alias - rdoc Documentation

  1. RDoc::
  2. Alias
class RDoc::Alias

Represent an alias, which is an old_name/new_name pair associated with a particular context

Attributes

Is this an alias declared in a singleton context?

Public Class Methods

Source

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

Creates a new Alias with a token stream of text that aliases old_name to new_name, has comment and is a singleton context.

Public Instance Methods

Source

def <=>(other)
  [@singleton ? 0 : 1, new_name] <=> [other.singleton ? 0 : 1, other.new_name]
end

Order by singleton then new_name

Source

def aref
  type = singleton ? 'c' : 'i'
  "#alias-#{type}-#{html_name}"
end

HTML fragment reference for this alias

Source

def html_name
  CGI.escape(@new_name.gsub('-', '-2D')).gsub('%', '-').sub(/^-/, '')
end

HTML id-friendly version of new_name.

Source

def name_prefix
  singleton ? '::' : '#'
end

‘::’ for the alias of a singleton method/attribute, ‘#’ for instance-level.

Source

def pretty_new_name
  "#{singleton ? '::' : '#'}#{@new_name}"
end

New name with prefix ‘::’ or ‘#’.

Source

def 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