diff --git a/lib/datastore/entity.js b/lib/datastore/entity.js index 0089e3ed7ea..5f859153261 100644 --- a/lib/datastore/entity.js +++ b/lib/datastore/entity.js @@ -50,21 +50,21 @@ function Key(path) { module.exports.Key = Key; function Int(val) { - this.val = val; + this.val_ = val; } Int.prototype.get = function() { - return this.val; + return this.val_; }; module.exports.Int = Int; function Double(val) { - this.val = val; + this.val_ = val; } Double.prototype.get = function() { - return this.val; + return this.val_; }; module.exports.Double = Double; diff --git a/lib/datastore/index.js b/lib/datastore/index.js index f0bbf029b33..6696127b807 100644 --- a/lib/datastore/index.js +++ b/lib/datastore/index.js @@ -24,10 +24,10 @@ module.exports = { // TODO(jbd): Handle arguments in entity.Key constructor. return new entity.Key([].slice.call(arguments)); }, - Int: function(value) { + int: function(value) { return new entity.Int(value); }, - Double: function(value) { + double: function(value) { return new entity.Double(value); } }; diff --git a/test/datastore/index.js b/test/datastore/index.js index e479c3c13c3..a71fa6e3913 100644 --- a/test/datastore/index.js +++ b/test/datastore/index.js @@ -44,13 +44,13 @@ describe('Datastore', function() { it('should expose Int builder', function() { var anInt = 7; - datastore.Int(anInt); + datastore.int(anInt); assert.equal(entity.intCalledWith, anInt); }); it('should expose Double builder', function() { var aDouble = 7.0; - datastore.Double(aDouble); + datastore.double(aDouble); assert.equal(entity.doubleCalledWith, aDouble); }); }); diff --git a/test/datastore/query.js b/test/datastore/query.js index 913cd973050..54c7b37a731 100644 --- a/test/datastore/query.js +++ b/test/datastore/query.js @@ -120,7 +120,7 @@ describe('Query', function() { it('should be converted to a query proto successfully', function(done) { var q = ds.createQuery(['Kind']) .select(['name', 'count']) - .filter('count >=', datastore.Int(5)) + .filter('count >=', datastore.int(5)) .filter('name =', 'Burcu') .order('-count') .groupBy(['count'])