Our list calls return their results wrapped in an object so that we
can include extra information. We use this, e.g., to include the URL
to query for more records in the Transfer#transactions sublist.
When you get a ListObject, if you want to actually manipulate it as a
list, you have to call `#data` first to get the actual underlying
list.
This adds an exception to the `#[]` method to make what's going on
clearer.
Fixes#68
Make the SSL checks, user agent assembly, and request header
generation separate methods.
Also switch to class instance variables instead of class variables and
accessors instead of custom functions, and wrap lines to 80
characters.
Original patches come with thanks to Stevie Graham (with some style
fixups from me).
(fixes#53, fixes#54)
It seems to embrace the 'Ruby Way' (and more convenient in my own code) to be able to access an upcoming invoice from the customer itself rather than de-reference the customer id and ask the Invoice class itself for that info.
Attempting to spawn a subprocess to get the uname threw an out of
memory error. Since the uname is only needed to provide diagnostic
info in the User-Agent, it shouldn't cause stripe to fail.
Rationale:
Sometime you don't care about the current state of a resource
you just want to update one of it's attributes.
It should only require one request.
fixes#52
```ruby
c = Stripe::Customer.new("cus_1EqKjPaFs4ZwDD")
c.description = 'Ny new Description'
c.save
```
Before:
```json
{
error: {
type: "invalid_request_error",
message: "A parameter provided in the URL (id) was repeated as a GET or POST parameter. You can only provide this information as a portion of the URL.",
param: "id",
}
}
```
After:
Successfully update the customer and return it's whole state.