lib/twitter/rest/api/favorites.rb in twitter-5.0.0.rc.1 vs lib/twitter/rest/api/favorites.rb in twitter-5.0.0
- old
+ new
@@ -29,16 +29,13 @@
# @param options [Hash] A customizable set of options.
# @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100.
# @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID.
def favorites(*args)
arguments = Twitter::Arguments.new(args)
- if user = arguments.pop
- merge_user!(arguments.options, user)
- end
+ merge_user!(arguments.options, arguments.pop) if arguments.last
objects_from_response(Twitter::Tweet, :get, "/1.1/favorites/list.json", arguments.options)
end
- alias favourites favorites
# Un-favorites the specified Tweets as the authenticating user
#
# @see https://dev.twitter.com/docs/api/1.1/post/favorites/destroy
# @rate_limited No
@@ -51,13 +48,12 @@
# @param tweets [Enumerable<Integer, String, URI, Twitter::Tweet>] A collection of Tweet IDs, URIs, or objects.
# @param options [Hash] A customizable set of options.
def unfavorite(*args)
threaded_objects_from_response(Twitter::Tweet, :post, "/1.1/favorites/destroy.json", args)
end
- alias favorite_destroy unfavorite
- alias favourite_destroy unfavorite
- alias unfavourite unfavorite
+ alias destroy_favorite unfavorite
+ deprecate_alias :favorite_destroy, :unfavorite
# Favorites the specified Tweets as the authenticating user
#
# @see https://dev.twitter.com/docs/api/1.1/post/favorites/create
# @rate_limited No
@@ -80,12 +76,11 @@
end
end.compact
end
alias fav favorite
alias fave favorite
- alias favorite_create favorite
- alias favourite_create favorite
+ deprecate_alias :favorite_create, :favorite
# Favorites the specified Tweets as the authenticating user and raises an error if one has already been favorited
#
# @see https://dev.twitter.com/docs/api/1.1/post/favorites/create
# @rate_limited No
@@ -107,13 +102,13 @@
rescue Twitter::Error::Forbidden => error
handle_forbidden_error(Twitter::Error::AlreadyFavorited, error)
end
end
end
+ alias create_favorite! favorite!
alias fav! favorite!
alias fave! favorite!
- alias favorite_create! favorite!
- alias favourite_create! favorite!
+ deprecate_alias :favorite_create!, :favorite!
end
end
end
end