Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Implemented Client#group(group_name, options)

  • Loading branch information...
commit dcd1d24eed6c77ed701b73e99d81a73c8886f06c 1 parent 1157d42
@antono authored
Showing with 12 additions and 1 deletion.
  1. +12 −1 lib/portable_contacts.rb
View
13 lib/portable_contacts.rb
@@ -42,7 +42,18 @@ def me(options={})
def all(options={})
collection(get("/@me/@all",options.reverse_merge(:fields=>:all,:count=>100)))
end
-
+
+ # Return all contacts of specified group. It defaults to all fields and 100 entries
+ #
+ # @contacts = @client.gorup('friends') # return 100 contacts from 'friends' group
+ # @contacts = @client.gorup('friends' :count=>10) # return 10 contacts
+ # @contacts = @client.group('friends', :count=>10, :start_index => 10)
+ # # returns the second page of 10 contacts
+ #
+ def group(group_name, options = {})
+ collection(get("/@me/#{group_name}", options.reverse_merge(:fields=>:all, :count=>100)))
+ end
+
# Returns the full contact infor for a particular userid. TODO This is not tested well
# Returns an PortableContacts::Person object
def find(id, options={})
Please sign in to comment.
Something went wrong with that request. Please try again.