Class: Melbourne::AST::OpAssign2

Inherits:
Node
  • Object
show all
Defined in:
lib/melbourne/ast/operators.rb

Overview

TODO: document!

Instance Attribute Summary collapse

Attributes inherited from Node

#line

Instance Method Summary collapse

Methods inherited from Node

#ascii_graph

Constructor Details

#initialize(line, receiver, name, op, value) ⇒ OpAssign2

Returns a new instance of OpAssign2.



86
87
88
89
90
91
92
93
# File 'lib/melbourne/ast/operators.rb', line 86

def initialize(line, receiver, name, op, value)
  @line = line
  @receiver = receiver
  @name = name
  @op = op
  @value = value
  @assign = name.to_s[-1] == ?= ? name : :"#{name}="
end

Instance Attribute Details

#assignObject

Returns the value of attribute assign.



82
83
84
# File 'lib/melbourne/ast/operators.rb', line 82

def assign
  @assign
end

#nameObject

Returns the value of attribute name.



80
81
82
# File 'lib/melbourne/ast/operators.rb', line 80

def name
  @name
end

#opObject

Returns the value of attribute op.



78
79
80
# File 'lib/melbourne/ast/operators.rb', line 78

def op
  @op
end

#receiverObject

Returns the value of attribute receiver.



76
77
78
# File 'lib/melbourne/ast/operators.rb', line 76

def receiver
  @receiver
end

#valueObject

Returns the value of attribute value.



84
85
86
# File 'lib/melbourne/ast/operators.rb', line 84

def value
  @value
end