a simpler API with less magic

introduces a lazy loaded shared client, to remove the need for API consumers to instantiate their own. this is more idiomatic (in Ruby, and especially Rails libraries), but can make depedency injection harder (for customization, extension, testing, stubbing etc). this implementation aims to enjoy the best of both worlds.

95% of the time, you just need to define a single API key, and the consuming code is simpler:

    Delighted.api_key = '123abc'
    Delighted::Metrics.retrieve
    Delighted::Person.create(email: 'foo@bar.com')

for the other 5% of the time where you want to define your own client (either you want to integrate with multiple API keys, or you wish to provide a test double client), you can do so:

    Delighted.shared_client = ...
    Delighted::Metrics.retrieve
    Delighted::Person.create(email: 'foo@bar.com')

or, by instantiating a client instance yourself which you pass as the final argument when calling a resource operation:

    custom_client = Delighted::Client.new(...)
    Delighted::Metrics.retrieve({}, custom_client)
    Delighted::Person.create({ email: 'foo@bar.com' }, custom_client)
fix 1.8 compat
support serializing Time/Date values to Integer automatically
rename for clarity