Class: Red::DefinitionNode::Alias

Inherits:
Red::DefinitionNode show all
Defined in:
lib/red/nodes/definition_nodes.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from String

#%, #*, #+, #<<, #<=>, #==, #=~, #[], #[]=, #capitalize, #capitalize!, #casecmp, #center, #chomp, #chomp!, #chop, #chop!, #concat, #count, #crypt, #delete, #delete!, #downcase, #downcase!, #each, #each_byte, #each_line, #empty?, #eql?, #gsub, #gsub!, #hash, #hex, #include?, #index, #insert, #inspect, #intern, #length, #ljust, #lstrip, #lstrip!, #match, #next, #next!, #oct, #replace, #reverse, #reverse!, #rindex, #rjust, #rstrip, #rstrip!, #scan, #size, #slice, #slice!, #split, #squeeze, #strip, #strip!, #strip_scripts, #sub, #sub!, #succ, #succ!, #sum, #swapcase, #swapcase!, #to_f, #to_i, #to_s, #to_str, #to_sym, #tr, #tr!, #tr_s, #tr_s!, #upcase, #upcase!, #upto

Constructor Details

#initialize(new_method_name_sexp, old_method_name_sexp, options) ⇒ Alias

Returns a new instance of Alias.



4
5
6
7
8
9
# File 'lib/red/nodes/definition_nodes.rb', line 4

def initialize(new_method_name_sexp, old_method_name_sexp, options)
  new_method_name = new_method_name_sexp.last.red!
  old_method_name = old_method_name_sexp.last.red!
  self << "_.m$%s=_.m$%s" % [new_method_name, old_method_name]
  @@red_methods |= [old_method_name_sexp.last] unless @@red_import
end