ample/surveygizmo — pull request #12 by whereisciao (2012-09-25 15:45:08+00:00)
Title: Rich Object Class

# This Pull Request is not ready to be pulled

The next goal is to create Rich Data Objects. With all the responses from Surveygizmo wrapped in an object, we will be able to add functionality to manipulate the data as the business needs.

A few details to take note.

The functions `object_from_response` and soon `collection_from_response ` are the two functions that converts a request into an object. Another eventual goal is to create some sugar syntax for pagination.

Next, all endpoints will have a class. Below is an example of the Account class.

```
module Surveygizmo
class Account < Surveygizmo::Identity
include Surveygizmo::Creatable
attr_reader :organization, :contact_phone, :resellers_customer_id, :reseller_uuid

def login_link
@login_link ||= CGI.unescape(@attrs[:login_link]) unless @attrs[:login_link].nil?
end

def reseller
@attrs[:reseller]
end
end
end
```

This is open for discussion. My plans are to define all the endpoints them move to refactoring errors.