gocardless/open-companies-house — pull request #5 by whamilton42 (2013-08-08 21:00:09+00:00)
Title: Human readable response methods

This patch defines a method on the `Response` object for every top-level key in the `@attributes` hash. If the value of the hash was a simple object, it will be returned when the method is called. If the value of the hash was *another* hash, the method will return an `OpenStruct`, allowing the chaining of method calls.

For example, where previously you would have to call `company["RegAddress"]["AddressLine1"]`, you may now call `company.reg_address.address_line1`.

The existing `[]` method call is untouched and still available for use.