visitConstructModel()

in lib/generator.js [1452:1468]


  visitConstructModel(ast, level) {
    assert.equal(ast.type, 'construct_model');
    if (ast.object && ast.object.fields && ast.object.fields.length > 0 && !this.exec) {
      this.visitType(ast.inferred);
      this.emit(`.build(`);
      this.visitObject(ast.object, level);
      this.emit(`)`);
      return;
    }
    this.emit(`new `);
    this.visitType(ast.inferred);
    this.emit(`()`);

    if (this.exec) {
      this.visitSetMethod(ast.object, level);
    }
  }