codegram/hyperclient — pull request #29 by arbylee (2013-05-03 19:30:26+00:00)
Title: Handle JSON that includes a link with a null value

Previously, if the value of a link was ```null```, Hyperclient would generate a Link object with nil href, etc. Subsequent access of Link#url and other methods had potential to raise NoMethodError as a result. Thus, it was unwieldy to check for null links via the Hyperclient API.

This PR changes Hyperclient's behavior: null links now result in nil values in the LinkCollection. Therefore, clients can check whether a link is nil, and thereby have good behavior when null links are present.

For example:
```
{
...,
"_links" : {
"optional" : null
}
}
```

```ruby
optional_link = api.links.optional
if optional_link
...
end
```