Class: TRuby::IR::InstanceVariable

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

Overview

Instance variable declaration

Instance Attribute Summary collapse

Attributes inherited from Node

#location, #metadata, #type_info

Instance Method Summary collapse

Methods inherited from Node

#accept, #children, #transform

Constructor Details

#initialize(name:, type_annotation: nil, **opts) ⇒ InstanceVariable

Returns a new instance of InstanceVariable.



107
108
109
110
111
# File 'lib/t_ruby/ir.rb', line 107

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

Instance Attribute Details

#nameObject

Returns the value of attribute name.



105
106
107
# File 'lib/t_ruby/ir.rb', line 105

def name
  @name
end

#type_annotationObject

Returns the value of attribute type_annotation.



105
106
107
# File 'lib/t_ruby/ir.rb', line 105

def type_annotation
  @type_annotation
end