def follow(followed, public: true)
      if followed.is_a? Array
        ids = followed.map(&:id).join(',')
        type = followed.first.type
      else
        ids = followed.id
        type = followed.type
      end

      if type == 'playlist'
        request_body = { public: public }
        url = "users/#{followed.owner.id}/playlists/#{followed.id}/followers"
      else
        request_body = {}
        url = "me/following?type=#{type}&ids=#{ids}"
      end

      User.oauth_put(@id, url, request_body.to_json)
      followed
    end
def follow(followed, public: true)
      if followed.is_a? Array
        ids = followed.map(&:id).join(',')
        type = followed.first.type
      else
        ids = followed.id
        type = followed.type
      end

      if type == 'playlist'
        request_body = { public: public }
        url = "users/#{followed.owner.id}/playlists/#{followed.id}/followers"
      else
        request_body = {}
        url = "me/following?type=#{type}&ids=#{ids}"
      end

      User.oauth_put(@id, url, request_body.to_json)
      followed
    end
Add the current user as a follower of one or more artists, other Spotify users or a playlist. Following artists or users require the *user-follow-modify*
 scope. Following a playlist publicly requires the *playlist-modify-public* scope; following it privately requires the *playlist-modify-private* scope.

 @note Scopes you provide for playlists determine only whether the current user can themselves follow the playlist publicly or privately (i.e. show others what they are following), not whether the playlist itself is public or private.

 @param followed [Artist, Array<Artist>, User, Array<User>, Playlist] The artists, users or playlist to follow
 @param public [Boolean] If true the playlist will be included in user's public playlists, if false it will remain private.
 @return [Artist, Array<Artist>, User, Array<User>, Playlist]

 @example
           artists = RSpotify::Artist.search('John')
           user.follow(artists)

           playlist = RSpotify::Playlist.search('Movie').first
           user.follow(playlist, public: false)