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
121 122 123 124 125 126 127 128 129 |
# File 'lib/t_ruby/ir.rb', line 121 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.
119 120 121 |
# File 'lib/t_ruby/ir.rb', line 119 def body @body end |
#name ⇒ Object
Returns the value of attribute name.
119 120 121 |
# File 'lib/t_ruby/ir.rb', line 119 def name @name end |
#params ⇒ Object
Returns the value of attribute params.
119 120 121 |
# File 'lib/t_ruby/ir.rb', line 119 def params @params end |
#return_type ⇒ Object
Returns the value of attribute return_type.
119 120 121 |
# File 'lib/t_ruby/ir.rb', line 119 def return_type @return_type end |
#type_params ⇒ Object
Returns the value of attribute type_params.
119 120 121 |
# File 'lib/t_ruby/ir.rb', line 119 def type_params @type_params end |
#visibility ⇒ Object
Returns the value of attribute visibility.
119 120 121 |
# File 'lib/t_ruby/ir.rb', line 119 def visibility @visibility end |
Instance Method Details
#children ⇒ Object
131 132 133 |
# File 'lib/t_ruby/ir.rb', line 131 def children [@body].compact end |