Class: Red::AssignmentNode::InstanceVariableNode

Inherits:
Red::AssignmentNode show all
Defined in:
lib/red/assignment_nodes.rb

Overview

:nodoc:

Instance Method Summary collapse

Methods inherited from Red::AssignmentNode

#call_to_increment?, #compile_increment, #compile_internals, #initialize

Constructor Details

This class inherits a constructor from Red::AssignmentNode

Instance Method Details

#compile_node(options = {}) ⇒ Object



42
43
44
45
46
# File 'lib/red/assignment_nodes.rb', line 42

def compile_node(options = {})
  receiver = "this.%s" % @variable_name.compile_node
  return self.compile_increment(:receiver => receiver) if self.call_to_increment?
  return "%s = %s" % [receiver, @expression.compile_node(:as_argument => true)]
end