Class: TRuby::IR::MethodCall

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

Overview

Method call

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(method_name:, receiver: nil, arguments: [], block: nil, type_args: [], **opts) ⇒ MethodCall

Returns a new instance of MethodCall.



196
197
198
199
200
201
202
203
# File 'lib/t_ruby/ir.rb', line 196

def initialize(method_name:, receiver: nil, arguments: [], block: nil, type_args: [], **opts)
  super(**opts)
  @receiver = receiver
  @method_name = method_name
  @arguments = arguments
  @block = block
  @type_args = type_args
end

Instance Attribute Details

#argumentsObject

Returns the value of attribute arguments.



194
195
196
# File 'lib/t_ruby/ir.rb', line 194

def arguments
  @arguments
end

#blockObject

Returns the value of attribute block.



194
195
196
# File 'lib/t_ruby/ir.rb', line 194

def block
  @block
end

#method_nameObject

Returns the value of attribute method_name.



194
195
196
# File 'lib/t_ruby/ir.rb', line 194

def method_name
  @method_name
end

#receiverObject

Returns the value of attribute receiver.



194
195
196
# File 'lib/t_ruby/ir.rb', line 194

def receiver
  @receiver
end

#type_argsObject

Returns the value of attribute type_args.



194
195
196
# File 'lib/t_ruby/ir.rb', line 194

def type_args
  @type_args
end

Instance Method Details

#childrenObject



205
206
207
# File 'lib/t_ruby/ir.rb', line 205

def children
  ([@receiver, @block] + @arguments).compact
end