Module: GoogleContactsApi::Groups
- Included in:
- User
- Defined in:
- lib/google_contacts_api/groups.rb
Instance Method Summary collapse
-
#get_groups(params = {}) ⇒ Object
Retrieve the contacts for this user or group.
Instance Method Details
#get_groups(params = {}) ⇒ Object
Retrieve the contacts for this user or group
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/google_contacts_api/groups.rb', line 5 def get_groups(params = {}) params = params.with_indifferent_access # compose params into a string # See http://code.google.com/apis/contacts/docs/3.0/reference.html#Parameters # alt, q, max-results, start-index, updated-min, # orderby, showdeleted, requirealldeleted, sortorder params["max-results"] = 100000 unless params.key?("max-results") url = "groups/default/full" response = @api.get(url, params) case GoogleContactsApi::Api.parse_response_code(response) # TODO: Better handle 401, 403, 404 when 401; raise when 403; raise when 404; raise when 400...500; raise when 500...600; raise end GoogleContactsApi::GroupSet.new(response.body, @api) end |