<commit_before>module Peruse
  class Friend
    attr_accessor :web
    # @param [Web] web object
    def initialize(web)
      @web = web
    end

    # Array of users with email and username
    def all
      xml_doc.xpath('/MediaContainer/User').map {|n| [n['email'],n['username']] }
    end


    # @private
    def auth_token #:nodoc:
      web.auth_token
    end

    # @private
    def password #:nodoc:
      web.password
    end

    # @private
    def url #:nodoc:
      'https://plex.tv/pms/friends/all'
    end

    # @private
    def username #:nodoc:
      web.username
    end

    private
    def xml_doc
      Nokogiri::XML(RestClient::Request.execute(method: :get, url: url, user: username, password: password, headers: {'X-Plex-Client-Identifier' => 'perusev0.9'}))
    end

  end
end<commit_msg>document<commit_after>module Peruse
  class Friend
    attr_accessor :web
    # @param [Web] web object
    def initialize(web)
      @web = web
    end


    # Array of users with email and username
    def all
      xml_doc.xpath('/MediaContainer/User').map {|n| [n['email'],n['username']] }
    end


    # @private
    def auth_token #:nodoc:
      web.auth_token
    end

    # @private
    def password #:nodoc:
      web.password
    end

    # @private
    def url #:nodoc:
      'https://plex.tv/pms/friends/all'
    end

    # @private
    def username #:nodoc:
      web.username
    end

    private
    def xml_doc
      Nokogiri::XML(RestClient::Request.execute(method: :get, url: url, user: username, password: password, headers: {'X-Plex-Client-Identifier' => 'perusev0.9'}))
    end

  end
end
{'fraction_non_alphanumeric': 0.12192118226600986, 'fraction_numerical': 0.0024630541871921183, 'mean_word_length': 2.4138655462184873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3583835', 'n_tokens_mistral': 562, 'n_tokens_neox': 542, 'n_words': 137}