From cc2f8b542c022d16ebdfe821b281f2a094fa0478 Mon Sep 17 00:00:00 2001 From: Erik Michaels-Ober Date: Tue, 11 Feb 2014 17:05:07 +0100 Subject: [PATCH] Discourage setting the cursor manually [ci skip] --- lib/twitter/rest/friends_and_followers.rb | 10 ---------- lib/twitter/rest/lists.rb | 8 -------- lib/twitter/rest/undocumented.rb | 7 +------ 3 files changed, 1 insertion(+), 24 deletions(-) diff --git a/lib/twitter/rest/friends_and_followers.rb b/lib/twitter/rest/friends_and_followers.rb index 3b4a638a9..1d2614191 100644 --- a/lib/twitter/rest/friends_and_followers.rb +++ b/lib/twitter/rest/friends_and_followers.rb @@ -21,13 +21,11 @@ module FriendsAndFollowers # Returns an array of numeric IDs for every user the authenticated user is following # # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. This is recommended for users who are following many users. Provide a value of -1 to begin paging. Provide values as returned in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. # @overload friend_ids(user, options = {}) # Returns an array of numeric IDs for every user the specified user is following # # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object. # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. def friend_ids(*args) cursor_from_response_with_user(:ids, nil, :get, '/1.1/friends/ids.json', args) end @@ -41,13 +39,11 @@ def friend_ids(*args) # Returns an array of numeric IDs for every user following the authenticated user # # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. # @overload follower_ids(user, options = {}) # Returns an array of numeric IDs for every user following the specified user # # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object. # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. This is recommended for users who are following many users. Provide a value of -1 to begin paging. Provide values as returned in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. def follower_ids(*args) cursor_from_response_with_user(:ids, nil, :get, '/1.1/followers/ids.json', args) end @@ -78,7 +74,6 @@ def friendships(*args) # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. # @return [Twitter::Cursor] # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. def friendships_incoming(options = {}) perform_with_cursor(:get, '/1.1/friendships/incoming.json', options, :ids) end @@ -91,7 +86,6 @@ def friendships_incoming(options = {}) # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. # @return [Twitter::Cursor] # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. def friendships_outgoing(options = {}) perform_with_cursor(:get, '/1.1/friendships/outgoing.json', options, :ids) end @@ -223,7 +217,6 @@ def friendship?(source, target, options = {}) # Returns a cursored collection of user objects for users following the authenticated user. # # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. This is recommended for users who are following many users. Provide a value of -1 to begin paging. Provide values as returned in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. # @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1. # @option options [Boolean, String, Integer] :include_user_entities The user entities node will be disincluded when set to false. # @overload followers(user, options = {}) @@ -231,7 +224,6 @@ def friendship?(source, target, options = {}) # # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object. # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. # @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1. # @option options [Boolean, String, Integer] :include_user_entities The user entities node will be disincluded when set to false. def followers(*args) @@ -249,7 +241,6 @@ def followers(*args) # Returns a cursored collection of user objects for every user the authenticated user is following (otherwise known as their "friends"). # # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. This is recommended for users who are following many users. Provide a value of -1 to begin paging. Provide values as returned in the response body's next_cursor and previous_cursor attributes to page back and forth in the list. # @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1. # @option options [Boolean, String, Integer] :include_user_entities The user entities node will be disincluded when set to false. # @overload friends(user, options = {}) @@ -257,7 +248,6 @@ def followers(*args) # # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object. # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. # @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1. # @option options [Boolean, String, Integer] :include_user_entities The user entities node will be disincluded when set to false. def friends(*args) diff --git a/lib/twitter/rest/lists.rb b/lib/twitter/rest/lists.rb index 77de04025..adfecf8e5 100644 --- a/lib/twitter/rest/lists.rb +++ b/lib/twitter/rest/lists.rb @@ -92,12 +92,10 @@ def remove_list_member(*args) # @return [Twitter::Cursor] # @overload memberships(options = {}) # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. # @option options [Boolean, String, Integer] :filter_to_owned_lists When set to true, t or 1, will return just lists the authenticating user owns, and the user represented by user_id or screen_name is a member of. # @overload memberships(user, options = {}) # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object. # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. # @option options [Boolean, String, Integer] :filter_to_owned_lists When set to true, t or 1, will return just lists the authenticating user owns, and the user represented by user_id or screen_name is a member of. def memberships(*args) cursor_from_response_with_user(:lists, Twitter::List, :get, '/1.1/lists/memberships.json', args) @@ -113,12 +111,10 @@ def memberships(*args) # @overload list_subscribers(list, options = {}) # @param list [Integer, String, Twitter::List] A Twitter list ID, slug, URI, or object. # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. # @overload list_subscribers(user, list, options = {}) # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object. # @param list [Integer, String, Twitter::List] A Twitter list ID, slug, URI, or object. # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. def list_subscribers(*args) cursor_from_response_with_list(:get, '/1.1/lists/subscribers.json', args) end @@ -232,12 +228,10 @@ def list_member?(*args) # @overload list_members(list, options = {}) # @param list [Integer, String, Twitter::List] A Twitter list ID, slug, URI, or object. # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. # @overload list_members(user, list, options = {}) # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object. # @param list [Integer, String, Twitter::List] A Twitter list ID, slug, URI, or object. # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. def list_members(*args) cursor_from_response_with_list(:get, '/1.1/lists/members.json', args) end @@ -351,11 +345,9 @@ def list(*args) # @return [Twitter::Cursor] # @overload subscriptions(options = {}) # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. # @overload subscriptions(user, options = {}) # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object. # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. def subscriptions(*args) cursor_from_response_with_user(:lists, Twitter::List, :get, '/1.1/lists/subscriptions.json', args) end diff --git a/lib/twitter/rest/undocumented.rb b/lib/twitter/rest/undocumented.rb index 9787e4e27..48a629dd6 100644 --- a/lib/twitter/rest/undocumented.rb +++ b/lib/twitter/rest/undocumented.rb @@ -13,21 +13,16 @@ module Undocumented # @rate_limited Yes # @authentication Requires user context # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid. - # + # @return [Twitter::Cursor] # @overload following_followers_of(options = {}) # Returns users following followers of the specified user # # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. - # @return [Twitter::Cursor] - # # @overload following_followers_of(user, options = {}) # Returns users following followers of the authenticated user # # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object. # @param options [Hash] A customizable set of options. - # @option options [Integer] :cursor (-1) Breaks the results into pages. Provide values as returned in the response objects's next_cursor and previous_cursor attributes to page back and forth in the list. - # @return [Twitter::Cursor] def following_followers_of(*args) cursor_from_response_with_user(:users, Twitter::User, :get, '/users/following_followers_of.json', args) end