README.markdown in google_contacts_api-0.4.0 vs README.markdown in google_contacts_api-0.4.1

- old
+ new

@@ -10,26 +10,34 @@ Right now upgrading should just work, barring any bugs in my implementation. In the next major version I will probably drop (or at least stop maintaining) support for OAuth::AccessToken objects and depend directly on the [oauth2](https://github.com/intridea/oauth2) gem. ## Usage -You need to provide an OAuth client, with access token, from an OAuth access library to this library. I've tested it with OAuth::AccessToken from the [oauth-ruby](https://github.com/oauth/oauth-ruby) gem and an OAuth2::AccessToken from the [oauth2](https://github.com/intridea/oauth2) gem. I'm guessing there would be a few small changes in implementation details of the GoogleContactsApi::Api class if you use another library, mostly to change how the base get/post/put/delete methods work. +You need to pass to the `GoogleContactsApi::User` constructor one of the following two objects: +* an OAuth::AccessToken from the [oauth-ruby](https://github.com/oauth/oauth-ruby) gem +* an OAuth2::AccessToken from the [oauth2](https://github.com/intridea/oauth2) gem + +See their respective documentation for details on how to get this object. (I'm guessing there would be a few changes in implementation details of the GoogleContactsApi::Api class if you use another OAuth library, mostly to change how the base get/post/put/delete methods work.) + Then you can instantiate a GoogleContactsApi::Api object for direct posting and parsing, or a GoogleContactsApi::User object for easier stuff. ```ruby +oauth_access_token_for_user +# => <OAuth2::AccessToken:0x000000029a69d36> + google_contacts_user = GoogleContactsApi::User.new(oauth_access_token_for_user) contacts = google_contacts_user.contacts groups = google_contacts_user.groups # group methods -group = groups[0] +group = groups.first group.contacts # contact methods -contact = contacts[0] +contact = contacts.first contact.photo contact.title contact.id contact.primary_email contact.emails @@ -61,8 +69,10 @@ * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it. ## Copyright -Copyright (c) 2011-13 Alvin Liang. See LICENSE.txt for further details. +Copyright (c) 2011-14 Alvin Liang (aliang). See LICENSE.txt for further details. -Some code based on a few bugfixes in lfittl and fraudpointer forks. +Some code based on a few bugfixes in lfittl and fraudpointer forks. + +Support for Google Contacts API version 3 fields by draffensperger. \ No newline at end of file