UNPKG

gremlin-script

Version:
28 lines (19 loc) 588 B
'use strict'; var inherits = require('util').inherits; var GremlinMethod = require('../function'); function AddPropertiesMethod() { GremlinMethod.call(this, 'addProperties', arguments[0]); } inherits(AddPropertiesMethod, GremlinMethod); AddPropertiesMethod.prototype.run = function(element) { var key; var args = this.arguments; for (key in args) { element[key] = args[key]; } return element; }; AddPropertiesMethod.prototype.toGroovy = function() { return '.addProperties('+ this.stringifyArgument(this.arguments) +')'; }; module.exports = AddPropertiesMethod;