Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: #69 Renamed the DDPClient.prototype.call* functions to DDPClient.prototype.send* #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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 : "[email protected]" }, password : "password" }
], function (err, result) { ... });

// logging in with username
ddpclient.call("login", [
ddpclient.send("login", [
{ user : { username : "username" }, password : "password" }
], function (err, result) { ... });
```
Expand Down Expand Up @@ -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
Expand All @@ -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" }],
Expand Down
4 changes: 2 additions & 2 deletions examples/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" }],
Expand Down
4 changes: 2 additions & 2 deletions lib/ddp-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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();

Expand Down
8 changes: 4 additions & 4 deletions test/ddp-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, {}]]);
});

Expand Down Expand Up @@ -161,7 +161,7 @@ describe('Automatic reconnection', function() {
ddpclient._send = Function.prototype;

ddpclient.connect();
ddpclient.call();
ddpclient.send();

assert("_test" in ddpclient._pendingMethods)
});
Expand All @@ -172,7 +172,7 @@ describe('Automatic reconnection', function() {
ddpclient._send = Function.prototype;

ddpclient.connect();
ddpclient.call();
ddpclient.send();

assert("_test" in ddpclient._pendingMethods)

Expand All @@ -186,7 +186,7 @@ describe('Automatic reconnection', function() {
ddpclient._send = Function.prototype;

ddpclient.connect();
ddpclient.call();
ddpclient.send();

assert("_test" in ddpclient._pendingMethods)

Expand Down