Class: TRuby::IR::Assignment

Inherits:
Node
  • Object
show all
Defined in:
lib/t_ruby/ir.rb

Overview

Variable assignment

Instance Attribute Summary collapse

Attributes inherited from Node

#location, #metadata, #type_info

Instance Method Summary collapse

Methods inherited from Node

#accept, #transform

Constructor Details

#initialize(target:, value:, type_annotation: nil, **opts) ⇒ Assignment

Returns a new instance of Assignment.



168
169
170
171
172
173
# File 'lib/t_ruby/ir.rb', line 168

def initialize(target:, value:, type_annotation: nil, **opts)
  super(**opts)
  @target = target
  @value = value
  @type_annotation = type_annotation
end

Instance Attribute Details

#targetObject

Returns the value of attribute target.



166
167
168
# File 'lib/t_ruby/ir.rb', line 166

def target
  @target
end

#type_annotationObject

Returns the value of attribute type_annotation.



166
167
168
# File 'lib/t_ruby/ir.rb', line 166

def type_annotation
  @type_annotation
end

#valueObject

Returns the value of attribute value.



166
167
168
# File 'lib/t_ruby/ir.rb', line 166

def value
  @value
end

Instance Method Details

#childrenObject



175
176
177
# File 'lib/t_ruby/ir.rb', line 175

def children
  [@value]
end