gremlin-script
Version:
Generate Gremlin scripts with ease
28 lines (19 loc) • 588 B
JavaScript
;
var inherits = require('util').inherits;
var GremlinMethod = require('../function');
function SetPropertiesMethod() {
GremlinMethod.call(this, 'setProperties', arguments[0]);
}
inherits(SetPropertiesMethod, GremlinMethod);
SetPropertiesMethod.prototype.run = function(element) {
var key;
var args = this.arguments;
for (key in args) {
element[key] = args[key];
}
return element;
};
SetPropertiesMethod.prototype.toGroovy = function() {
return '.setProperties('+ this.stringifyArgument(this.arguments) +')';
};
module.exports = SetPropertiesMethod;