diff --git a/README.markdown b/README.markdown index 5bad225..4a6a600 100644 --- a/README.markdown +++ b/README.markdown @@ -20,12 +20,12 @@ One can authenticate using plain-text logins as follows: ```js // logging in with e-mail -ddpclient.call("login", [ +ddpclient.send("login", [ { user : { email : "user@domain.com" }, password : "password" } ], function (err, result) { ... }); // logging in with username -ddpclient.call("login", [ +ddpclient.send("login", [ { user : { username : "username" }, password : "password" } ], function (err, result) { ... }); ``` @@ -82,7 +82,7 @@ ddpclient.connect(function(error, wasReconnect) { /* * Call a Meteor Method */ - ddpclient.call( + ddpclient.send( 'deletePosts', // name of Meteor Method being called ['foo', 'bar'], // parameters to send to Meteor Method function (err, result) { // callback which returns the method call results @@ -103,7 +103,7 @@ ddpclient.connect(function(error, wasReconnect) { var Random = require("ddp-random"), random = Random.createWithSeeds("randomSeed"); // seed an id generator - ddpclient.callWithRandomSeed( + ddpclient.sendWithRandomSeed( 'createPost', // name of Meteor Method being called [{ _id : random.id(), // generate the id on the client body : "asdf" }], diff --git a/examples/example.js b/examples/example.js index 23038fa..8b6e154 100644 --- a/examples/example.js +++ b/examples/example.js @@ -43,7 +43,7 @@ ddpclient.connect(function(error, wasReconnect) { /* * Call a Meteor Method */ - ddpclient.call( + ddpclient.send( "deletePosts", // name of Meteor Method being called ["foo", "bar"], // parameters to send to Meteor Method function (err, result) { // callback which returns the method call results @@ -64,7 +64,7 @@ ddpclient.connect(function(error, wasReconnect) { var Random = require("ddp-random"), random = Random.createWithSeeds("randomSeed"); // seed an id generator - ddpclient.callWithRandomSeed( + ddpclient.sendWithRandomSeed( "createPost", // name of Meteor Method being called [{ _id : random.id(), // generate the id on the client body : "asdf" }], diff --git a/lib/ddp-client.js b/lib/ddp-client.js index 9e7ad73..d1471d5 100644 --- a/lib/ddp-client.js +++ b/lib/ddp-client.js @@ -418,7 +418,7 @@ DDPClient.prototype.close = function() { // call a method on the server, // // callback = function(err, result) -DDPClient.prototype.call = function(name, params, callback, updatedCallback) { +DDPClient.prototype.send = function(name, params, callback, updatedCallback) { var self = this; var id = self._getNextId(); @@ -449,7 +449,7 @@ DDPClient.prototype.call = function(name, params, callback, updatedCallback) { }; -DDPClient.prototype.callWithRandomSeed = function(name, params, randomSeed, callback, updatedCallback) { +DDPClient.prototype.sendWithRandomSeed = function(name, params, randomSeed, callback, updatedCallback) { var self = this; var id = self._getNextId(); diff --git a/test/ddp-client.js b/test/ddp-client.js index 31469d8..f88c5a3 100644 --- a/test/ddp-client.js +++ b/test/ddp-client.js @@ -29,7 +29,7 @@ describe("Connect to remote server", function() { assert(wsConstructor.calledOnce); assert(wsConstructor.calledWithNew()); - assert(wsConstructor.call); + assert(wsConstructor.send); assert.deepEqual(wsConstructor.args, [['ws://localhost:3000/websocket', null, {}]]); }); @@ -161,7 +161,7 @@ describe('Automatic reconnection', function() { ddpclient._send = Function.prototype; ddpclient.connect(); - ddpclient.call(); + ddpclient.send(); assert("_test" in ddpclient._pendingMethods) }); @@ -172,7 +172,7 @@ describe('Automatic reconnection', function() { ddpclient._send = Function.prototype; ddpclient.connect(); - ddpclient.call(); + ddpclient.send(); assert("_test" in ddpclient._pendingMethods) @@ -186,7 +186,7 @@ describe('Automatic reconnection', function() { ddpclient._send = Function.prototype; ddpclient.connect(); - ddpclient.call(); + ddpclient.send(); assert("_test" in ddpclient._pendingMethods)