UNPKG

gremlin-script

Version:
28 lines (19 loc) 588 B
'use strict'; 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;