yui/yui3 — pull request #179 by ericf (2012-07-05 21:50:45+00:00)
Title: Model Sync REST — A RESTful HTTP `sync()` layer for Model and ModelList.

This provides `Y.ModelSync.REST`, an extension which implements a RESTful HTTP `sync()` layer for `Y.Model` and `Y.ModelList`.

This makes it trivial for Model or ModelList subclasses to communicate and transmit JSON data via RESTful HTTP. In most cases developers only need to provide a value for `root` when sub-classing `Y.Model`, and only provide a value for `url` when sub-classing `Y.ModelList`.

This module began its life in the Gallery where it had to time be put through its paces and grow into something very useful which should be a core module in YUI:
http://yuilibrary.com/gallery/show/model-sync-rest

### Example Usage

```javascript
YUI().use('model', 'model-list', 'model-sync-rest', function (Y) {

var User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {
root: '/users',
});

var myUser = new User({id: '123'});
myUser.load(); // Will GET the User data from: "/users/123"

myUser.set('name', 'Eric F').save(); // Will PUT the User to: "/users/123"
myUser.destroy({remove: true}); // Will DELETE the User at: "/users/123"

var newUser = new User({name: 'Eric Ferraiuolo'});
newUser.save(); // Will POST the User data to: "/users"

});
```

### Running Locally

I explicitly did not commit the build files or the Loader metadata update, when trying out these changes locally, do the following:

```bash
$ cd src/loader/ && make
$ cd ../app/ && ant all
```

### Todos

* Initial drop
* Add more unit tests in increase code coverage
* Add info to Model's user guide