Class: Red::CallNode::Super

Inherits:
Red::CallNode show all
Defined in:
lib/red/nodes/call_nodes.rb

Overview

:nodoc:

Direct Known Subclasses

Delegate

Defined Under Namespace

Classes: Delegate

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(*arguments_array_sexp) ⇒ Super

:super, (:array, expression, expression, …)


120
121
122
123
124
125
126
127
# File 'lib/red/nodes/call_nodes.rb', line 120

def initialize(*arguments_array_sexp)
  options     = arguments_array_sexp.pop
  args_array  = arguments_array_sexp.last.is_sexp?(:array) ? arguments_array_sexp.last[1..-1].map {|argument_sexp| argument_sexp.red!(:as_argument => true)} : []
  args_array  = ["this"] + args_array
  args_array += [options[:block_string]] if options[:block_string]
  arguments   = args_array.join(",")
  self << "this.m$class().m$superclass().prototype.m$%s.call(%s)" % [@@red_function, arguments]
end