<commit_before>require_relative 'blinkbox-client'

#Blinkbox::ClientApi::Settings.client_settings({:server_uri => "nothing"})
#u = Blinkbox::ClientApi::User.new({:username => "test", :password => "password"})

module Blinkbox
  module ClientApi
    module Settings

      class ActiveSettings
        attr_reader :server_uri, :proxy_uri
        def initialize params
          @server_uri = params[:server_uri] || "https://auth.blinkboxbooks.com"
          @proxy_uri = params[:proxy_uri] || nil
        end
      end
    end

    class User < Client
      attr_reader :attributes
      def initialize params
        @user_credentials = params
        @attributes = {}
        super Settings::ActiveSettings.client_settings.server_uri,
        Settings::ActiveSettings.client_settings.proxy_uri
      end
      def refresh
        authenticate(@user_credentials)
        @attributes = MultiJson.load(HttpCapture::RESPONSES.last.body)
      end
      def method_missing(name, *args, &blk)
        if args.empty? && blk.nil? && @attributes.has_key?(name.to_s)
          @attributes[name.to_s]
        else<commit_msg>removed comment<commit_after>require_relative 'blinkbox-client'

module Blinkbox
  module ClientApi
    module Settings

      class ActiveSettings
        attr_reader :server_uri, :proxy_uri
        def initialize params
          @server_uri = params[:server_uri] || "https://auth.blinkboxbooks.com"
          @proxy_uri = params[:proxy_uri] || nil
        end
      end
    end

    class User < Client
      attr_reader :attributes
      def initialize params
        @user_credentials = params
        @attributes = {}
        super Settings::ActiveSettings.client_settings.server_uri,
        Settings::ActiveSettings.client_settings.proxy_uri
      end
      def refresh
        authenticate(@user_credentials)
        @attributes = MultiJson.load(HttpCapture::RESPONSES.last.body)
      end
      def method_missing(name, *args, &blk)
        if args.empty? && blk.nil? && @attributes.has_key?(name.to_s)
          @attributes[name.to_s]
        else
{'fraction_non_alphanumeric': 0.09792571152918475, 'fraction_numerical': 0.0, 'mean_word_length': 2.7846715328467155, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 6, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7420376', 'n_tokens_mistral': 600, 'n_tokens_neox': 591, 'n_words': 119}