Class: IV::Phonic::AST::ConstructorCall

Inherits:
Expression show all
Defined in:
lib/iv/phonic/ast.rb

Instance Method Summary collapse

Methods inherited from Expression

as

Methods inherited from Node

#begin_position, #end_position, #program, #source

Constructor Details

#initialize(parent, expr) ⇒ ConstructorCall

Returns a new instance of ConstructorCall.



521
522
523
524
525
# File 'lib/iv/phonic/ast.rb', line 521

def initialize parent, expr
  super parent, expr
  @target = Expression.as self, expr[:target]
  @args = expr[:args].map{|arg| Expression.as self, arg }
end

Instance Method Details

#to_sourceObject



527
528
529
# File 'lib/iv/phonic/ast.rb', line 527

def to_source
  "new #{@target.to_source}(#{args.map{|arg| arg.to_source }.join(', ')})"
end