Class: Red::AssignmentNode::Attribute
- Inherits:
-
Red::AssignmentNode
- Object
- String
- Red::AssignmentNode
- Red::AssignmentNode::Attribute
- Defined in:
- lib/red/nodes/assignment_nodes.rb
Overview
:nodoc:
Instance Method Summary collapse
-
#initialize(receiver_sexp, writer_sexp, arguments_array_sexp, options) ⇒ Attribute
constructor
[:attrasgn, expression, :foo= | :[]=, [:array, element, element, …]].
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(receiver_sexp, writer_sexp, arguments_array_sexp, options) ⇒ Attribute
- :attrasgn, expression, :foo= | :[]=, [:array, element, element, …]
60 61 62 63 64 65 |
# File 'lib/red/nodes/assignment_nodes.rb', line 60 def initialize(receiver_sexp, writer_sexp, arguments_array_sexp, ) receiver = receiver_sexp.red!(:as_receiver => true) writer = (METHOD_ESCAPE[writer_sexp] || writer_sexp).red! arguments = arguments_array_sexp[1..-1].map {|argument_sexp| argument_sexp.red!(:as_argument => true) }.join(",") self << "%s.m$%s(%s)" % [receiver, writer, arguments] end |