Right now we return a lot of hashes that are converted straight from JSON. The result is lots of mucking around client-side, and it's not very nice to test.
Instead, we should return objects. This means we can do things like call ->up or ->down directly on a task object, or ->fmt_status directly on a user object.
We should also provide a ->raw or ->json method to get the actual original data. This means if the API gets extended or changed, and WS::HRPG isn't updated (heaven forbid!), then end-developers still have a way to get to the info they need. It's also really useful for debugging and testing.
Right now we return a lot of hashes that are converted straight from JSON. The result is lots of mucking around client-side, and it's not very nice to test.
Instead, we should return objects. This means we can do things like call
->up
or->down
directly on a task object, or->fmt_status
directly on a user object.We should also provide a
->raw
or->json
method to get the actual original data. This means if the API gets extended or changed, and WS::HRPG isn't updated (heaven forbid!), then end-developers still have a way to get to the info they need. It's also really useful for debugging and testing.