Permalink
Browse files

Added cursor to lists method

  • Loading branch information...
1 parent 6f23c5e commit a16ad354be4fae3d3f86207d8c5ae8b4c2a11b52 @sferik committed Mar 21, 2010
Showing with 7 additions and 5 deletions.
  1. +7 −5 lib/twitter/base.rb
View
12 lib/twitter/base.rb
@@ -243,13 +243,15 @@ def list_delete(list_owner_username, slug)
perform_delete("/#{API_VERSION}/#{list_owner_username}/lists/#{slug}.json")
end
- def lists(list_owner_username=nil)
+ def lists(list_owner_username = nil, cursor = nil)
if list_owner_username
path = "/#{API_VERSION}/#{list_owner_username}/lists.json"
else
path = "/#{API_VERSION}/lists.json"
end
- perform_get(path)
+ query = {}
+ query[:cursor] = cursor if cursor
+ perform_get(path, :query => query)
end
def list(list_owner_username, slug)
@@ -267,9 +269,9 @@ def memberships(list_owner_username, query={})
end
def list_members(list_owner_username, slug, cursor = nil)
- path = "/#{API_VERSION}/#{list_owner_username}/#{slug}/members.json"
- path += "?cursor=#{cursor}" if cursor
- perform_get(path)
+ query = {}
+ query[:cursor] = cursor if cursor
+ perform_get("/#{API_VERSION}/#{list_owner_username}/#{slug}/members.json", :query => query)
end
def list_add_member(list_owner_username, slug, new_id)

0 comments on commit a16ad35

Please sign in to comment.