Class: IV::Phonic::AST::ConstructorCall
- Inherits:
-
Expression
- Object
- Node
- Expression
- IV::Phonic::AST::ConstructorCall
- Defined in:
- lib/iv/phonic/ast.rb
Instance Method Summary collapse
-
#initialize(parent, expr) ⇒ ConstructorCall
constructor
A new instance of ConstructorCall.
- #to_source ⇒ Object
Methods inherited from Expression
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_source ⇒ Object
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 |