asciidisco/Backbone.Rpc — pull request #15 by davidpodolsky (2013-05-13 17:01:23+00:00)
Title: Enhancement : Added support for by-named parameters. 

Sebastian thanks for making / sharing this great library. I needed by-name parameters in my recent project so I have added support in the backbone.rpc module. Below is the section I added to the README.md under the "Adding params to the methods section". Questions / comments let me know.

##### Using named parameters

The JSON-RPC 2.0 spec includes the support for passing parameters by-name.
You can enabled this functionality by setting 'useNamedParameters' to true in your Backbone.Rpc options.

```javascript
var DeviceModel = Backbone.Model.extend({
url: '/api',
rpc: new Backbone.Rpc({
useNamedParameters: true
}),
methods: {
read: ['getFilteredDevicesById', 'id'],
}
});
...
deviceModel.set({id: 14});
deviceModel.fetch(); // Calls 'read'

// Params is an object with named parameters
{"jsonrpc":"2.0","method":"getFilteredDevicesById","id":"1331724849298","params":{"id":"14"}}:
```