<commit_before>module LayerVault
  module Configurable
    attr_accessor :access_token, :api_endpoint, :user_agent, :middleware

    class << self
      def keys
        @keys ||= [
          :access_token,
          :api_endpoint,
          :user_agent,
          :middleware
        ]
      end
    end

    def configure
      yield self
    end

    def reset!
      LayerVault::Configurable.keys.each do |key|
        instance_variable_set(:"@#{key}", LayerVault::Default.options[key])
      end
      self
    end

    alias setup reset!

    def api_endpoint
      ::File.join(@api_endpoint, "")
    end

    private

    def options
      Hash[LayerVault::Configurable.keys.map{|key| [key, instance_variable_get(:"@#{key}")]}]
    end
  end
end
<commit_msg>Fixes #4 - API Endpoint doesn't get set through LayerVault.client.api_endpoint<commit_after>module LayerVault
  module Configurable
    attr_accessor :access_token, :user_agent, :middleware
    attr_writer :api_endpoint

    class << self
      def keys
        @keys ||= [
          :access_token,
          :api_endpoint,
          :user_agent,
          :middleware
        ]
      end
    end

    def configure
      yield self
    end

    def reset!
      LayerVault::Configurable.keys.each do |key|
        instance_variable_set(:"@#{key}", LayerVault::Default.options[key])
      end
      self
    end

    alias setup reset!

    def api_endpoint
      ::File.join(@api_endpoint, "")
    end

    private

    def options
      Hash[LayerVault::Configurable.keys.map{|key| [key, instance_variable_get(:"@#{key}")]}]
    end
  end
end

{'fraction_non_alphanumeric': 0.10062111801242236, 'fraction_numerical': 0.0006211180124223603, 'mean_word_length': 2.274390243902439, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '3383049', 'n_tokens_mistral': 514, 'n_tokens_neox': 493, 'n_words': 111}