Class: Melbourne::AST::ElementAssignment

Inherits:
SendWithArguments show all
Defined in:
lib/melbourne/ast/sends.rb

Overview

An element assignment as in:

a[0] = 1

Instance Attribute Summary

Attributes inherited from SendWithArguments

#arguments

Attributes inherited from Send

#block, #check_for_local, #name, #privately, #receiver, #variable

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, receiver, arguments) ⇒ ElementAssignment

Returns a new instance of ElementAssignment.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# File 'lib/melbourne/ast/sends.rb', line 83

def initialize(line, receiver, arguments)
  @line = line

  @receiver = receiver
  @privately = receiver.kind_of?(Self) ? true : false

  @name = :[]=

  case arguments
  when PushArgs
    @arguments = arguments
  else
    @arguments = ActualArguments.new line, arguments
  end
end