twitter 5.0.0 → 5.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. data/.yardopts +4 -0
  2. data/CHANGELOG.md +47 -0
  3. data/CONTRIBUTING.md +5 -5
  4. data/README.md +57 -56
  5. data/Rakefile +26 -5
  6. data/lib/twitter/arguments.rb +1 -2
  7. data/lib/twitter/base.rb +15 -18
  8. data/lib/twitter/basic_user.rb +3 -3
  9. data/lib/twitter/client.rb +9 -10
  10. data/lib/twitter/configuration.rb +5 -5
  11. data/lib/twitter/creatable.rb +0 -1
  12. data/lib/twitter/cursor.rb +9 -36
  13. data/lib/twitter/direct_message.rb +1 -1
  14. data/lib/twitter/entity/uri.rb +2 -2
  15. data/lib/twitter/enumerable.rb +10 -1
  16. data/lib/twitter/error/already_favorited.rb +1 -1
  17. data/lib/twitter/error/already_posted.rb +1 -1
  18. data/lib/twitter/error/already_retweeted.rb +1 -1
  19. data/lib/twitter/error/too_many_requests.rb +2 -2
  20. data/lib/twitter/error.rb +6 -6
  21. data/lib/twitter/factory.rb +2 -6
  22. data/lib/twitter/geo/point.rb +3 -5
  23. data/lib/twitter/geo.rb +1 -1
  24. data/lib/twitter/geo_factory.rb +1 -5
  25. data/lib/twitter/geo_results.rb +5 -8
  26. data/lib/twitter/identity.rb +1 -2
  27. data/lib/twitter/list.rb +10 -11
  28. data/lib/twitter/media/photo.rb +1 -2
  29. data/lib/twitter/media_factory.rb +1 -5
  30. data/lib/twitter/null_object.rb +4 -6
  31. data/lib/twitter/oembed.rb +1 -1
  32. data/lib/twitter/place.rb +17 -6
  33. data/lib/twitter/profile_banner.rb +1 -3
  34. data/lib/twitter/rate_limit.rb +1 -3
  35. data/lib/twitter/relationship.rb +1 -2
  36. data/lib/twitter/rest/api/direct_messages.rb +15 -15
  37. data/lib/twitter/rest/api/favorites.rb +15 -15
  38. data/lib/twitter/rest/api/friends_and_followers.rb +37 -42
  39. data/lib/twitter/rest/api/help.rb +8 -9
  40. data/lib/twitter/rest/api/lists.rb +69 -69
  41. data/lib/twitter/rest/api/oauth.rb +3 -4
  42. data/lib/twitter/rest/api/places_and_geo.rb +9 -10
  43. data/lib/twitter/rest/api/saved_searches.rb +8 -8
  44. data/lib/twitter/rest/api/search.rb +10 -2
  45. data/lib/twitter/rest/api/spam_reporting.rb +1 -2
  46. data/lib/twitter/rest/api/suggested_users.rb +4 -5
  47. data/lib/twitter/rest/api/timelines.rb +17 -18
  48. data/lib/twitter/rest/api/trends.rb +10 -11
  49. data/lib/twitter/rest/api/tweets.rb +31 -20
  50. data/lib/twitter/rest/api/undocumented.rb +6 -7
  51. data/lib/twitter/rest/api/users.rb +53 -54
  52. data/lib/twitter/rest/api/utils.rb +28 -34
  53. data/lib/twitter/rest/client.rb +8 -9
  54. data/lib/twitter/rest/request/multipart_with_file.rb +7 -5
  55. data/lib/twitter/rest/response/parse_error_json.rb +0 -2
  56. data/lib/twitter/rest/response/parse_json.rb +2 -2
  57. data/lib/twitter/rest/response/raise_error.rb +1 -3
  58. data/lib/twitter/search_results.rb +38 -56
  59. data/lib/twitter/settings.rb +2 -2
  60. data/lib/twitter/size.rb +2 -2
  61. data/lib/twitter/source_user.rb +1 -1
  62. data/lib/twitter/streaming/client.rb +69 -18
  63. data/lib/twitter/streaming/connection.rb +1 -3
  64. data/lib/twitter/streaming/deleted_tweet.rb +8 -0
  65. data/lib/twitter/streaming/event.rb +8 -8
  66. data/lib/twitter/streaming/friend_list.rb +2 -9
  67. data/lib/twitter/streaming/message_parser.rb +13 -3
  68. data/lib/twitter/streaming/response.rb +0 -2
  69. data/lib/twitter/streaming/stall_warning.rb +7 -0
  70. data/lib/twitter/suggestion.rb +0 -1
  71. data/lib/twitter/token.rb +2 -3
  72. data/lib/twitter/trend_results.rb +5 -8
  73. data/lib/twitter/tweet.rb +17 -18
  74. data/lib/twitter/user.rb +33 -35
  75. data/lib/twitter/utils.rb +14 -0
  76. data/lib/twitter/version.rb +2 -5
  77. data/lib/twitter.rb +1 -1
  78. data/spec/fixtures/forbidden.json +1 -0
  79. data/spec/fixtures/search.json +1 -1
  80. data/spec/fixtures/search2.json +1 -0
  81. data/spec/fixtures/track_streaming_user.json +2 -1
  82. data/spec/helper.rb +6 -2
  83. data/spec/twitter/base_spec.rb +9 -9
  84. data/spec/twitter/basic_user_spec.rb +6 -6
  85. data/spec/twitter/configuration_spec.rb +4 -4
  86. data/spec/twitter/cursor_spec.rb +13 -51
  87. data/spec/twitter/direct_message_spec.rb +36 -36
  88. data/spec/twitter/entity/uri_spec.rb +29 -29
  89. data/spec/twitter/error_spec.rb +21 -21
  90. data/spec/twitter/geo/point_spec.rb +9 -9
  91. data/spec/twitter/geo/polygon_spec.rb +5 -5
  92. data/spec/twitter/geo_factory_spec.rb +7 -7
  93. data/spec/twitter/geo_results_spec.rb +11 -11
  94. data/spec/twitter/geo_spec.rb +5 -5
  95. data/spec/twitter/identifiable_spec.rb +9 -9
  96. data/spec/twitter/list_spec.rb +38 -38
  97. data/spec/twitter/media/photo_spec.rb +58 -58
  98. data/spec/twitter/media_factory_spec.rb +5 -5
  99. data/spec/twitter/null_object_spec.rb +6 -6
  100. data/spec/twitter/oembed_spec.rb +68 -68
  101. data/spec/twitter/place_spec.rb +91 -62
  102. data/spec/twitter/profile_banner_spec.rb +3 -3
  103. data/spec/twitter/rate_limit_spec.rb +18 -18
  104. data/spec/twitter/relationship_spec.rb +16 -16
  105. data/spec/twitter/rest/api/direct_messages_spec.rb +61 -61
  106. data/spec/twitter/rest/api/favorites_spec.rb +93 -93
  107. data/spec/twitter/rest/api/friends_and_followers_spec.rb +357 -349
  108. data/spec/twitter/rest/api/geo_spec.rb +33 -33
  109. data/spec/twitter/rest/api/help_spec.rb +24 -24
  110. data/spec/twitter/rest/api/lists_spec.rb +487 -487
  111. data/spec/twitter/rest/api/oauth_spec.rb +30 -30
  112. data/spec/twitter/rest/api/saved_searches_spec.rb +50 -40
  113. data/spec/twitter/rest/api/search_spec.rb +27 -26
  114. data/spec/twitter/rest/api/spam_reporting_spec.rb +9 -9
  115. data/spec/twitter/rest/api/suggested_users_spec.rb +23 -23
  116. data/spec/twitter/rest/api/timelines_spec.rb +58 -58
  117. data/spec/twitter/rest/api/trends_spec.rb +26 -26
  118. data/spec/twitter/rest/api/tweets_spec.rb +304 -266
  119. data/spec/twitter/rest/api/undocumented_spec.rb +51 -51
  120. data/spec/twitter/rest/api/users_spec.rb +360 -360
  121. data/spec/twitter/rest/client_spec.rb +99 -103
  122. data/spec/twitter/saved_search_spec.rb +16 -16
  123. data/spec/twitter/search_results_spec.rb +14 -110
  124. data/spec/twitter/settings_spec.rb +8 -8
  125. data/spec/twitter/size_spec.rb +5 -5
  126. data/spec/twitter/source_user_spec.rb +6 -6
  127. data/spec/twitter/streaming/client_spec.rb +85 -54
  128. data/spec/twitter/streaming/deleted_tweet_spec.rb +23 -0
  129. data/spec/twitter/streaming/event_spec.rb +20 -22
  130. data/spec/twitter/streaming/friend_list_spec.rb +11 -0
  131. data/spec/twitter/streaming/message_parser_spec.rb +54 -0
  132. data/spec/twitter/suggestion_spec.rb +11 -11
  133. data/spec/twitter/target_user_spec.rb +6 -6
  134. data/spec/twitter/token_spec.rb +4 -4
  135. data/spec/twitter/trend_results_spec.rb +30 -30
  136. data/spec/twitter/trend_spec.rb +21 -21
  137. data/spec/twitter/tweet_spec.rb +178 -164
  138. data/spec/twitter/user_spec.rb +190 -190
  139. data/twitter.gemspec +6 -6
  140. data.tar.gz.sig +0 -0
  141. metadata +44 -16
  142. metadata.gz.sig +0 -0
  143. data/lib/twitter/core_ext/enumerable.rb +0 -10
  144. data/lib/twitter/core_ext/kernel.rb +0 -10
  145. data/spec/twitter_spec.rb +0 -0
@@ -4,6 +4,7 @@ require 'twitter/error/forbidden'
4
4
  require 'twitter/rest/api/utils'
5
5
  require 'twitter/tweet'
6
6
  require 'twitter/user'
7
+ require 'twitter/utils'
7
8
 
8
9
  module Twitter
9
10
  module REST
@@ -16,13 +17,13 @@ module Twitter
16
17
  # @authentication Requires user context
17
18
  # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
18
19
  # @return [Array<Twitter::Tweet>] favorite Tweets.
19
- # @overload favorites(options={})
20
+ # @overload favorites(options = {})
20
21
  # Returns the 20 most recent favorite Tweets for the authenticating user
21
22
  #
22
23
  # @param options [Hash] A customizable set of options.
23
24
  # @option options [Integer] :count Specifies the number of records to retrieve. Must be less than or equal to 100.
24
25
  # @option options [Integer] :since_id Returns results with an ID greater than (that is, more recent than) the specified ID.
25
- # @overload favorites(user, options={})
26
+ # @overload favorites(user, options = {})
26
27
  # Returns the 20 most recent favorite Tweets for the specified user
27
28
  #
28
29
  # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object.
@@ -32,7 +33,7 @@ module Twitter
32
33
  def favorites(*args)
33
34
  arguments = Twitter::Arguments.new(args)
34
35
  merge_user!(arguments.options, arguments.pop) if arguments.last
35
- objects_from_response(Twitter::Tweet, :get, "/1.1/favorites/list.json", arguments.options)
36
+ objects_from_response(Twitter::Tweet, :get, '/1.1/favorites/list.json', arguments.options)
36
37
  end
37
38
 
38
39
  # Un-favorites the specified Tweets as the authenticating user
@@ -48,9 +49,9 @@ module Twitter
48
49
  # @param tweets [Enumerable<Integer, String, URI, Twitter::Tweet>] A collection of Tweet IDs, URIs, or objects.
49
50
  # @param options [Hash] A customizable set of options.
50
51
  def unfavorite(*args)
51
- threaded_objects_from_response(Twitter::Tweet, :post, "/1.1/favorites/destroy.json", args)
52
+ threaded_objects_from_response(Twitter::Tweet, :post, '/1.1/favorites/destroy.json', args)
52
53
  end
53
- alias destroy_favorite unfavorite
54
+ alias_method :destroy_favorite, :unfavorite
54
55
  deprecate_alias :favorite_destroy, :unfavorite
55
56
 
56
57
  # Favorites the specified Tweets as the authenticating user
@@ -67,17 +68,17 @@ module Twitter
67
68
  # @param options [Hash] A customizable set of options.
68
69
  def favorite(*args)
69
70
  arguments = Twitter::Arguments.new(args)
70
- arguments.flatten.threaded_map do |tweet|
71
+ Twitter::Utils.parallel_map(arguments) do |tweet|
71
72
  id = extract_id(tweet)
72
73
  begin
73
- object_from_response(Twitter::Tweet, :post, "/1.1/favorites/create.json", arguments.options.merge(:id => id))
74
+ object_from_response(Twitter::Tweet, :post, '/1.1/favorites/create.json', arguments.options.merge(:id => id))
74
75
  rescue Twitter::Error::Forbidden => error
75
76
  raise unless error.message == Twitter::Error::AlreadyFavorited::MESSAGE
76
77
  end
77
78
  end.compact
78
79
  end
79
- alias fav favorite
80
- alias fave favorite
80
+ alias_method :fav, :favorite
81
+ alias_method :fave, :favorite
81
82
  deprecate_alias :favorite_create, :favorite
82
83
 
83
84
  # Favorites the specified Tweets as the authenticating user and raises an error if one has already been favorited
@@ -95,20 +96,19 @@ module Twitter
95
96
  # @param options [Hash] A customizable set of options.
96
97
  def favorite!(*args)
97
98
  arguments = Twitter::Arguments.new(args)
98
- arguments.flatten.threaded_map do |tweet|
99
+ Twitter::Utils.parallel_map(arguments) do |tweet|
99
100
  id = extract_id(tweet)
100
101
  begin
101
- object_from_response(Twitter::Tweet, :post, "/1.1/favorites/create.json", arguments.options.merge(:id => id))
102
+ object_from_response(Twitter::Tweet, :post, '/1.1/favorites/create.json', arguments.options.merge(:id => id))
102
103
  rescue Twitter::Error::Forbidden => error
103
104
  handle_forbidden_error(Twitter::Error::AlreadyFavorited, error)
104
105
  end
105
106
  end
106
107
  end
107
- alias create_favorite! favorite!
108
- alias fav! favorite!
109
- alias fave! favorite!
108
+ alias_method :create_favorite!, :favorite!
109
+ alias_method :fav!, :favorite!
110
+ alias_method :fave!, :favorite!
110
111
  deprecate_alias :favorite_create!, :favorite!
111
-
112
112
  end
113
113
  end
114
114
  end
@@ -4,6 +4,7 @@ require 'twitter/error/forbidden'
4
4
  require 'twitter/relationship'
5
5
  require 'twitter/rest/api/utils'
6
6
  require 'twitter/user'
7
+ require 'twitter/utils'
7
8
 
8
9
  module Twitter
9
10
  module REST
@@ -16,19 +17,19 @@ module Twitter
16
17
  # @authentication Requires user context
17
18
  # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
18
19
  # @return [Twitter::Cursor]
19
- # @overload friend_ids(options={})
20
+ # @overload friend_ids(options = {})
20
21
  # Returns an array of numeric IDs for every user the authenticated user is following
21
22
  #
22
23
  # @param options [Hash] A customizable set of options.
23
24
  # @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.
24
- # @overload friend_ids(user, options={})
25
+ # @overload friend_ids(user, options = {})
25
26
  # Returns an array of numeric IDs for every user the specified user is following
26
27
  #
27
28
  # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object.
28
29
  # @param options [Hash] A customizable set of options.
29
30
  # @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.
30
31
  def friend_ids(*args)
31
- cursor_from_response_with_user(:ids, nil, :get, "/1.1/friends/ids.json", args)
32
+ cursor_from_response_with_user(:ids, nil, :get, '/1.1/friends/ids.json', args)
32
33
  end
33
34
 
34
35
  # @see https://dev.twitter.com/docs/api/1.1/get/followers/ids
@@ -36,19 +37,19 @@ module Twitter
36
37
  # @authentication Requires user context
37
38
  # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
38
39
  # @return [Twitter::Cursor]
39
- # @overload follower_ids(options={})
40
+ # @overload follower_ids(options = {})
40
41
  # Returns an array of numeric IDs for every user following the authenticated user
41
42
  #
42
43
  # @param options [Hash] A customizable set of options.
43
44
  # @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.
44
- # @overload follower_ids(user, options={})
45
+ # @overload follower_ids(user, options = {})
45
46
  # Returns an array of numeric IDs for every user following the specified user
46
47
  #
47
48
  # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object.
48
49
  # @param options [Hash] A customizable set of options.
49
50
  # @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.
50
51
  def follower_ids(*args)
51
- cursor_from_response_with_user(:ids, nil, :get, "/1.1/followers/ids.json", args)
52
+ cursor_from_response_with_user(:ids, nil, :get, '/1.1/followers/ids.json', args)
52
53
  end
53
54
 
54
55
  # Returns the relationship of the authenticating user to the comma separated list of up to 100 screen_names or user_ids provided. Values for connections can be: following, following_requested, followed_by, none.
@@ -66,7 +67,7 @@ module Twitter
66
67
  def friendships(*args)
67
68
  arguments = Twitter::Arguments.new(args)
68
69
  merge_users!(arguments.options, arguments)
69
- objects_from_response(Twitter::User, :get, "/1.1/friendships/lookup.json", arguments.options)
70
+ objects_from_response(Twitter::User, :get, '/1.1/friendships/lookup.json', arguments.options)
70
71
  end
71
72
 
72
73
  # Returns an array of numeric IDs for every user who has a pending request to follow the authenticating user
@@ -78,8 +79,8 @@ module Twitter
78
79
  # @return [Twitter::Cursor]
79
80
  # @param options [Hash] A customizable set of options.
80
81
  # @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.
81
- def friendships_incoming(options={})
82
- cursor_from_response(:ids, nil, :get, "/1.1/friendships/incoming.json", options)
82
+ def friendships_incoming(options = {})
83
+ cursor_from_response(:ids, nil, :get, '/1.1/friendships/incoming.json', options)
83
84
  end
84
85
 
85
86
  # Returns an array of numeric IDs for every protected user for whom the authenticating user has a pending follow request
@@ -91,8 +92,8 @@ module Twitter
91
92
  # @return [Twitter::Cursor]
92
93
  # @param options [Hash] A customizable set of options.
93
94
  # @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.
94
- def friendships_outgoing(options={})
95
- cursor_from_response(:ids, nil, :get, "/1.1/friendships/outgoing.json", options)
95
+ def friendships_outgoing(options = {})
96
+ cursor_from_response(:ids, nil, :get, '/1.1/friendships/outgoing.json', options)
96
97
  end
97
98
 
98
99
  # Allows the authenticating user to follow the specified users, unless they are already followed
@@ -118,7 +119,7 @@ module Twitter
118
119
  end
119
120
  follow!(new_friends.value - existing_friends.value, arguments.options)
120
121
  end
121
- alias create_friendship follow
122
+ alias_method :create_friendship, :follow
122
123
  deprecate_alias :friendship_create, :follow
123
124
 
124
125
  # Allows the authenticating user to follow the specified users
@@ -136,16 +137,11 @@ module Twitter
136
137
  # @option options [Boolean] :follow (false) Enable notifications for the target user.
137
138
  def follow!(*args)
138
139
  arguments = Twitter::Arguments.new(args)
139
- arguments.flatten.threaded_map do |user|
140
- begin
141
- object_from_response(Twitter::User, :post, "/1.1/friendships/create.json", merge_user(arguments.options, user))
142
- rescue Twitter::Error::Forbidden
143
- # This error will be raised if the user doesn't have permission to
144
- # follow list_member, for whatever reason.
145
- end
140
+ Twitter::Utils.parallel_map(arguments) do |user|
141
+ object_from_response(Twitter::User, :post, '/1.1/friendships/create.json', merge_user(arguments.options, user))
146
142
  end.compact
147
143
  end
148
- alias create_friendship! follow!
144
+ alias_method :create_friendship!, :follow!
149
145
  deprecate_alias :friendship_create!, :follow!
150
146
 
151
147
  # Allows the authenticating user to unfollow the specified users
@@ -161,9 +157,9 @@ module Twitter
161
157
  # @param users [Enumerable<Integer, String, Twitter::User>] A collection of Twitter user IDs, screen names, or objects.
162
158
  # @param options [Hash] A customizable set of options.
163
159
  def unfollow(*args)
164
- threaded_user_objects_from_response(:post, "/1.1/friendships/destroy.json", args)
160
+ threaded_user_objects_from_response(:post, '/1.1/friendships/destroy.json', args)
165
161
  end
166
- alias destroy_friendship unfollow
162
+ alias_method :destroy_friendship, :unfollow
167
163
  deprecate_alias :friendship_destroy, :unfollow
168
164
 
169
165
  # Allows one to enable or disable retweets and device notifications from the specified user.
@@ -177,9 +173,9 @@ module Twitter
177
173
  # @param options [Hash] A customizable set of options.
178
174
  # @option options [Boolean] :device Enable/disable device notifications from the target user.
179
175
  # @option options [Boolean] :retweets Enable/disable retweets from the target user.
180
- def friendship_update(user, options={})
176
+ def friendship_update(user, options = {})
181
177
  merge_user!(options, user)
182
- object_from_response(Twitter::Relationship, :post, "/1.1/friendships/update.json", options)
178
+ object_from_response(Twitter::Relationship, :post, '/1.1/friendships/update.json', options)
183
179
  end
184
180
 
185
181
  # Returns detailed information about the relationship between two users
@@ -192,15 +188,15 @@ module Twitter
192
188
  # @param source [Integer, String, Twitter::User] The Twitter user ID, screen name, or object of the source user.
193
189
  # @param target [Integer, String, Twitter::User] The Twitter user ID, screen name, or object of the target user.
194
190
  # @param options [Hash] A customizable set of options.
195
- def friendship(source, target, options={})
196
- merge_user!(options, source, "source")
191
+ def friendship(source, target, options = {})
192
+ merge_user!(options, source, 'source')
197
193
  options[:source_id] = options.delete(:source_user_id) unless options[:source_user_id].nil?
198
- merge_user!(options, target, "target")
194
+ merge_user!(options, target, 'target')
199
195
  options[:target_id] = options.delete(:target_user_id) unless options[:target_user_id].nil?
200
- object_from_response(Twitter::Relationship, :get, "/1.1/friendships/show.json", options)
196
+ object_from_response(Twitter::Relationship, :get, '/1.1/friendships/show.json', options)
201
197
  end
202
- alias friendship_show friendship
203
- alias relationship friendship
198
+ alias_method :friendship_show, :friendship
199
+ alias_method :relationship, :friendship
204
200
 
205
201
  # Test for the existence of friendship between two users
206
202
  #
@@ -212,7 +208,7 @@ module Twitter
212
208
  # @param source [Integer, String, Twitter::User] The Twitter user ID, screen name, or object of the source user.
213
209
  # @param target [Integer, String, Twitter::User] The Twitter user ID, screen name, or object of the target user.
214
210
  # @param options [Hash] A customizable set of options.
215
- def friendship?(source, target, options={})
211
+ def friendship?(source, target, options = {})
216
212
  friendship(source, target, options).source.following?
217
213
  end
218
214
 
@@ -223,14 +219,14 @@ module Twitter
223
219
  # @authentication Requires user context
224
220
  # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
225
221
  # @return [Twitter::Cursor]
226
- # @overload followers(options={})
222
+ # @overload followers(options = {})
227
223
  # Returns a cursored collection of user objects for users following the authenticated user.
228
224
  #
229
225
  # @param options [Hash] A customizable set of options.
230
226
  # @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.
231
227
  # @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1.
232
228
  # @option options [Boolean, String, Integer] :include_user_entities The user entities node will be disincluded when set to false.
233
- # @overload followers(user, options={})
229
+ # @overload followers(user, options = {})
234
230
  # Returns a cursored collection of user objects for users following the specified user.
235
231
  #
236
232
  # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object.
@@ -239,7 +235,7 @@ module Twitter
239
235
  # @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1.
240
236
  # @option options [Boolean, String, Integer] :include_user_entities The user entities node will be disincluded when set to false.
241
237
  def followers(*args)
242
- cursor_from_response_with_user(:users, Twitter::User, :get, "/1.1/followers/list.json", args)
238
+ cursor_from_response_with_user(:users, Twitter::User, :get, '/1.1/followers/list.json', args)
243
239
  end
244
240
 
245
241
  # Returns a cursored collection of user objects for every user the specified user is following (otherwise known as their "friends").
@@ -249,14 +245,14 @@ module Twitter
249
245
  # @authentication Requires user context
250
246
  # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
251
247
  # @return [Twitter::Cursor]
252
- # @overload friends(options={})
248
+ # @overload friends(options = {})
253
249
  # Returns a cursored collection of user objects for every user the authenticated user is following (otherwise known as their "friends").
254
250
  #
255
251
  # @param options [Hash] A customizable set of options.
256
252
  # @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.
257
253
  # @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1.
258
254
  # @option options [Boolean, String, Integer] :include_user_entities The user entities node will be disincluded when set to false.
259
- # @overload friends(user, options={})
255
+ # @overload friends(user, options = {})
260
256
  # Returns a cursored collection of user objects for every user the specified user is following (otherwise known as their "friends").
261
257
  #
262
258
  # @param user [Integer, String, Twitter::User] A Twitter user ID, screen name, URI, or object.
@@ -265,9 +261,9 @@ module Twitter
265
261
  # @option options [Boolean, String, Integer] :skip_status Do not include contributee's Tweets when set to true, 't' or 1.
266
262
  # @option options [Boolean, String, Integer] :include_user_entities The user entities node will be disincluded when set to false.
267
263
  def friends(*args)
268
- cursor_from_response_with_user(:users, Twitter::User, :get, "/1.1/friends/list.json", args)
264
+ cursor_from_response_with_user(:users, Twitter::User, :get, '/1.1/friends/list.json', args)
269
265
  end
270
- alias following friends
266
+ alias_method :following, :friends
271
267
 
272
268
  # Returns a collection of user IDs that the currently authenticated user does not want to receive retweets from.
273
269
  # @see https://dev.twitter.com/docs/api/1.1/get/friendships/no_retweets/ids
@@ -276,11 +272,10 @@ module Twitter
276
272
  # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
277
273
  # @return [Array<Integer>]
278
274
  # @param options [Hash] A customizable set of options.
279
- def no_retweet_ids(options={})
280
- get("/1.1/friendships/no_retweets/ids.json", options)[:body].map(&:to_i)
275
+ def no_retweet_ids(options = {})
276
+ get('/1.1/friendships/no_retweets/ids.json', options)[:body].map(&:to_i)
281
277
  end
282
- alias no_retweets_ids no_retweet_ids
283
-
278
+ alias_method :no_retweets_ids, :no_retweet_ids
284
279
  end
285
280
  end
286
281
  end
@@ -15,8 +15,8 @@ module Twitter
15
15
  # @authentication Requires user context
16
16
  # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
17
17
  # @return [Twitter::Configuration] Twitter's configuration.
18
- def configuration(options={})
19
- object_from_response(Twitter::Configuration, :get, "/1.1/help/configuration.json", options)
18
+ def configuration(options = {})
19
+ object_from_response(Twitter::Configuration, :get, '/1.1/help/configuration.json', options)
20
20
  end
21
21
 
22
22
  # Returns the list of languages supported by Twitter
@@ -26,8 +26,8 @@ module Twitter
26
26
  # @authentication Requires user context
27
27
  # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
28
28
  # @return [Array<Twitter::Language>]
29
- def languages(options={})
30
- objects_from_response(Twitter::Language, :get, "/1.1/help/languages.json", options)
29
+ def languages(options = {})
30
+ objects_from_response(Twitter::Language, :get, '/1.1/help/languages.json', options)
31
31
  end
32
32
 
33
33
  # Returns {https://twitter.com/privacy Twitter's Privacy Policy}
@@ -37,8 +37,8 @@ module Twitter
37
37
  # @authentication Requires user context
38
38
  # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
39
39
  # @return [String]
40
- def privacy(options={})
41
- get("/1.1/help/privacy.json", options)[:body][:privacy]
40
+ def privacy(options = {})
41
+ get('/1.1/help/privacy.json', options)[:body][:privacy]
42
42
  end
43
43
 
44
44
  # Returns {https://twitter.com/tos Twitter's Terms of Service}
@@ -48,10 +48,9 @@ module Twitter
48
48
  # @authentication Requires user context
49
49
  # @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
50
50
  # @return [String]
51
- def tos(options={})
52
- get("/1.1/help/tos.json", options)[:body][:tos]
51
+ def tos(options = {})
52
+ get('/1.1/help/tos.json', options)[:body][:tos]
53
53
  end
54
-
55
54
  end
56
55
  end
57
56
  end