redjack/halibut — pull request #23 by lwhorton (2014-09-09 13:15:22+00:00)
Title: canFollow() support

With a hal+api response, the API will not return the `next-page` or `prev-page` links if they don't exist; i.e. if you are on the first or last page of a collection.

This means unchecked calls to a collection might throw:

someResourceLink.follow('rj:next-page').then(...)
Instead, when iterating a collection, we should safe-check like so:

if (someResourceLink.canFollow('rj:next-page')) {
someResourceLink.follow('rj:next-page').then(...)
}

* Did I cover everything necessary in the specs?