codegram/hyperclient — pull request #34 by bkeepers (2013-06-11 14:19:17+00:00)
Title: Add Resource#rel, links and embeds are implementation details

From what I understand of HAL and hypermedia, links and embeds are implementation details that the consumer should not know about. **relations** are what matter.

[section 8.3 of the HAL draft](http://tools.ietf.org/html/draft-kelly-json-hal-05#section-8.3):

> The "hypertext cache pattern" allows servers to use embedded resources to dynamically reduce the number of requests a client makes, improving the efficiency and performance of the application. Clients MAY be automated for this purpose so that, for any given link relation, they will read from an embedded resource (if present) in preference to traversing a link.

> To activate this client behaviour for a given link, servers SHOULD add an embedded resource into the representation with the same relation.

So I propose that the following changes be made to Hyperclient.

* [x] Add a `#rel` method to `Resource` that first looks for an embedded resource and then a link.
* [ ] Add `#[]` and `#method_missing` on `Resource` that delegates to `#rel`
* [ ] Update all the docs to encourage the use `#rel` instead of `#links` and `#embedded`