flatiron/resourceful — pull request #125 by nrw (2012-10-24 23:57:16+00:00)
Title: Added 'getChild' method

Saves some repetition and allows you to `GET` less uneeded data.

Instead of doing this:

```javascript
// old api
_ = require('underscore')._;

exports.show = function(user, repo_id, callback) {
// user is a resource & repo_id is a resource uuid
user.repositories(function(err, repos) {
if (err) return callback(err);

var found = _(repos).find(function(repo) {
return repo.id.split('/').pop() === repo_id;
});

return callback(null, found);
});
};
```

You can do this:

```javascript
// new api in this commit
exports.show = function(user, repo_id, callback) {
// user is a resource & repo_id is a resource uuid
return user.getRepository(repo_id, function(err, repo) {
if (err) return callback(err);

return callback(null, repo);
});
};
```