Class: Red::DefinitionNode::Undef

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(function_name_sexp, options) ⇒ Undef

:undef, expression


193
194
195
196
197
198
# File 'lib/red/nodes/definition_nodes.rb', line 193

def initialize(function_name_sexp, options)
  return if @@red_import && !@@red_methods.include?(function_name_sexp)
  function_sexp = function_name_sexp.last.red!
  namespaced_function = @@namespace_stack.empty? ? function_sexp : (@@namespace_stack + ['prototype', "m$%s" % function_sexp]).join('.')
  self << "delete %s" % [namespaced_function]
end