Class: TRuby::IR::MethodDef
Overview
Method definition
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#name ⇒ Object
Returns the value of attribute name.
-
#params ⇒ Object
Returns the value of attribute params.
-
#return_type ⇒ Object
Returns the value of attribute return_type.
-
#type_params ⇒ Object
Returns the value of attribute type_params.
-
#visibility ⇒ Object
Returns the value of attribute visibility.
Attributes inherited from Node
#location, #metadata, #type_info
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize(name:, params: [], return_type: nil, body: nil, visibility: :public, type_params: [], **opts) ⇒ MethodDef
constructor
A new instance of MethodDef.
Methods inherited from Node
Constructor Details
#initialize(name:, params: [], return_type: nil, body: nil, visibility: :public, type_params: [], **opts) ⇒ MethodDef
Returns a new instance of MethodDef.
133 134 135 136 137 138 139 140 141 |
# File 'lib/t_ruby/ir.rb', line 133 def initialize(name:, params: [], return_type: nil, body: nil, visibility: :public, type_params: [], **opts) super(**opts) @name = name @params = params @return_type = return_type @body = body @visibility = visibility @type_params = type_params end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
131 132 133 |
# File 'lib/t_ruby/ir.rb', line 131 def body @body end |
#name ⇒ Object
Returns the value of attribute name.
131 132 133 |
# File 'lib/t_ruby/ir.rb', line 131 def name @name end |
#params ⇒ Object
Returns the value of attribute params.
131 132 133 |
# File 'lib/t_ruby/ir.rb', line 131 def params @params end |
#return_type ⇒ Object
Returns the value of attribute return_type.
131 132 133 |
# File 'lib/t_ruby/ir.rb', line 131 def return_type @return_type end |
#type_params ⇒ Object
Returns the value of attribute type_params.
131 132 133 |
# File 'lib/t_ruby/ir.rb', line 131 def type_params @type_params end |
#visibility ⇒ Object
Returns the value of attribute visibility.
131 132 133 |
# File 'lib/t_ruby/ir.rb', line 131 def visibility @visibility end |
Instance Method Details
#children ⇒ Object
143 144 145 |
# File 'lib/t_ruby/ir.rb', line 143 def children [@body].compact end |