Skip to content

Commit

Permalink
Move merge_default_cursor! inside cursor_from_response
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Dec 20, 2012
1 parent 3f1fdb5 commit ecf657b
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 7 deletions.
2 changes: 0 additions & 2 deletions lib/twitter/api/friends_and_followers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def friendships(*args)
# @example Return an array of numeric IDs for every user who has a pending request to follow the authenticating user
# Twitter.friendships_incoming
def friendships_incoming(options={})
merge_default_cursor!(options)
cursor_from_response(:ids, nil, :get, "/1.1/friendships/incoming.json", options, :friendships_incoming)
end

Expand All @@ -109,7 +108,6 @@ def friendships_incoming(options={})
# @example Return an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request
# Twitter.friendships_outgoing
def friendships_outgoing(options={})
merge_default_cursor!(options)
cursor_from_response(:ids, nil, :get, "/1.1/friendships/outgoing.json", options, :friendships_outgoing)
end

Expand Down
1 change: 0 additions & 1 deletion lib/twitter/api/lists.rb
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,6 @@ def list_from_response(request_method, path, args)

def list_users(request_method, path, args, calling_method)
options = extract_options!(args)
merge_default_cursor!(options)
merge_list!(options, args.pop)
merge_owner!(options, args.pop || screen_name) unless options[:owner_id] || options[:owner_screen_name]
cursor_from_response(:users, Twitter::User, request_method, path, options, calling_method)
Expand Down
1 change: 0 additions & 1 deletion lib/twitter/api/undocumented.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ def activity_by_friends(options={})
# Twitter.following_followers_of(7505382) # Same as above
def following_followers_of(*args)
options = extract_options!(args)
merge_default_cursor!(options)
merge_user!(options, args.pop || screen_name) unless options[:user_id] || options[:screen_name]
cursor_from_response(:users, Twitter::User, :get, "/users/following_followers_of.json", options, :following_followers_of)
end
Expand Down
1 change: 0 additions & 1 deletion lib/twitter/api/users.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ def update_profile_image(image, options={})
# @example Return an array of user objects that the authenticating user is blocking
# Twitter.blocking
def blocking(options={})
merge_default_cursor!(options)
cursor_from_response(:users, Twitter::User, :get, "/1.1/blocks/list.json", options, :blocking)
end

Expand Down
3 changes: 1 addition & 2 deletions lib/twitter/api/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def objects_from_response(klass, request_method, path, args)
# @return [Array<Integer>]
def ids_from_response(request_method, path, args, method_name)
options = extract_options!(args)
merge_default_cursor!(options)
merge_user!(options, args.pop)
cursor_from_response(:ids, nil, request_method, path, options, method_name)
end
Expand All @@ -70,7 +69,6 @@ def ids_from_response(request_method, path, args, method_name)
# @return [Twitter::Cursor]
def cursor_object_from_response(collection_name, klass, request_method, path, args, method_name)
options = extract_options!(args)
merge_default_cursor!(options)
merge_user!(options, args.pop || screen_name) unless options[:user_id] || options[:screen_name]
cursor_from_response(collection_name, klass, request_method, path, options, method_name)
end
Expand All @@ -83,6 +81,7 @@ def cursor_object_from_response(collection_name, klass, request_method, path, ar
# @param method_name [Symbol]
# @return [Twitter::Cursor]
def cursor_from_response(collection_name, klass, request_method, path, params, method_name)
merge_default_cursor!(params)
response = send(request_method.to_sym, path, params)
Twitter::Cursor.from_response(response, collection_name.to_sym, klass, self, method_name, params)
end
Expand Down

0 comments on commit ecf657b

Please sign in to comment.