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.



212
213
214
215
216
217
218
219
# File 'lib/t_ruby/ir.rb', line 212

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.



210
211
212
# File 'lib/t_ruby/ir.rb', line 210

def arguments
  @arguments
end

#blockObject

Returns the value of attribute block.



210
211
212
# File 'lib/t_ruby/ir.rb', line 210

def block
  @block
end

#method_nameObject

Returns the value of attribute method_name.



210
211
212
# File 'lib/t_ruby/ir.rb', line 210

def method_name
  @method_name
end

#receiverObject

Returns the value of attribute receiver.



210
211
212
# File 'lib/t_ruby/ir.rb', line 210

def receiver
  @receiver
end

#type_argsObject

Returns the value of attribute type_args.



210
211
212
# File 'lib/t_ruby/ir.rb', line 210

def type_args
  @type_args
end

Instance Method Details

#childrenObject



221
222
223
# File 'lib/t_ruby/ir.rb', line 221

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