DecodeSourceDecodeLanguageRubyAlias

class Alias

Represents an alias statement, e.g., alias new_name old_name or alias_method :new_name, :old_name

Definitions

def initialize(new_name, old_name, **options)

Initialize a new alias definition.

Signature

parameter new_name String

The new name for the alias.

parameter old_name String

The original name being aliased.

parameter options Hash

Additional options for the definition.

Implementation

def initialize(new_name, old_name, **options)
	super(new_name, **options)
	@old_name = old_name
end

def short_form

Generate a short form representation of the alias.

Implementation

def short_form
	"alias #{self.name} #{@old_name}"
end

def long_form

Generate a long form representation of the alias.

Implementation

def long_form
	"alias #{self.name} #{@old_name}"
end

def to_s

Generate a string representation of the alias.

Implementation

def to_s
	"#{self.class.name} #{self.name} -> #{@old_name}"
end