mailchimp/mailchimp-gem — pull request #1 by wnadeau (2012-01-25 22:40:08+00:00)
Title: Base class to DRY things up and move Export out of API class (gibbon code)

It started when I wanted to pass a specific timeout into the constructor or for one request like this

export.list(id: "1234", timeout: 300)

rather than this

export.timeout = 300
export.list(id: "1234")

Then I couldn't bring myself to add it just to the old Gibbon export code, but where was some place universal to put it? So I fleshed out a Base class, hooked up some inheritance and started reducing. Any API-specific uniqueness can be handled with overrides in the subclasses.

Anyway, not all duplication has been removed in this first commit, so far only STS/Mandrill/Export have been updated. There were some encoding differences with the API class/tests that will take more time to convert, and I didn't feel like ironing that out today.

Figured it was worth at least starting the discussion here.