Class: TRuby::IR::ClassDecl

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

Overview

Class declaration

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(name:, superclass: nil, implements: [], type_params: [], body: [], **opts) ⇒ ClassDecl

Returns a new instance of ClassDecl.



88
89
90
91
92
93
94
95
# File 'lib/t_ruby/ir.rb', line 88

def initialize(name:, superclass: nil, implements: [], type_params: [], body: [], **opts)
  super(**opts)
  @name = name
  @superclass = superclass
  @implements = implements
  @type_params = type_params
  @body = body
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



86
87
88
# File 'lib/t_ruby/ir.rb', line 86

def body
  @body
end

#implementsObject

Returns the value of attribute implements.



86
87
88
# File 'lib/t_ruby/ir.rb', line 86

def implements
  @implements
end

#nameObject

Returns the value of attribute name.



86
87
88
# File 'lib/t_ruby/ir.rb', line 86

def name
  @name
end

#superclassObject

Returns the value of attribute superclass.



86
87
88
# File 'lib/t_ruby/ir.rb', line 86

def superclass
  @superclass
end

#type_paramsObject

Returns the value of attribute type_params.



86
87
88
# File 'lib/t_ruby/ir.rb', line 86

def type_params
  @type_params
end

Instance Method Details

#childrenObject



97
98
99
# File 'lib/t_ruby/ir.rb', line 97

def children
  @body
end