lib/twitter/rest/friends_and_followers.rb
# Allows the authenticating user to follow the specified users, unless they are already followed
#
# @see https://dev.twitter.com/rest/reference/post/friendships/create
# @rate_limited Yes
# @authentication Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @return [Array<Twitter::User>] The followed users.
# @overload follow(*users)
#   @param users [Enumerable<Integer, String, Twitter::User>] A collection of Twitter user IDs, screen names, or objects.
# @overload follow(*users, options)
#   @param users [Enumerable<Integer, String, Twitter::User>] A collection of Twitter user IDs, screen names, or objects.
#   @param options [Hash] A customizable set of options.
#   @option options [Boolean] :follow (false) Enable notifications for the target user.
Allows the authenticating user to follow the specified users, unless they are already followed
Allows the authenticating user to follow the specified users unless they are already followed
def follow(*args)
        arguments = Twitter::Arguments.new(args)
        existing_friends = Thread.new do
          friend_ids.to_a
        end
        new_friends = Thread.new do
          users(args).collect(&:id)
        end
        follow!(new_friends.value - existing_friends.value, arguments.options)
      end
def follow ( * args ) arguments = Twitter :: Arguments . new ( args ) existing_friends = Thread . new do friend_ids . to_a end new_friends = Thread . new do users ( args ) . collect ( & :id ) end follow! ( new_friends . value - existing_friends . value , arguments . options ) end
Allows the authenticating user to follow the specified users, unless they are already followed
Allows the authenticating user to follow the specified users unless they are already followed
The followed users.
The followed users .
Array<Twitter::User>
[Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
[ Twitter :: Error :: Unauthorized ] Error raised when supplied user credentials are not valid .
args
<not_specific>
see
None
rate_limited
None
authentication
Requires user context
Requires user context
overload
follow(*users) @param users [Enumerable] A collection of Twitter user IDs, screen names, or objects.
follow ( * users ) @param users [ Enumerable ] A collection of Twitter user IDs screen names or objects .
overload
follow(*users, options) @param users [Enumerable] A collection of Twitter user IDs, screen names, or objects. @param options [Hash] A customizable set of options. @option options [Boolean] :follow (false) Enable notifications for the target user.
follow ( * users options ) @param users [ Enumerable ] A collection of Twitter user IDs screen names or objects . @param options [ Hash ] A customizable set of options . @option options [ Boolean ] : follow ( false ) Enable notifications for the target user .