<commit_before>module Signnow
  module Request
    class Info
      attr_accessor :http_method, :api_url, :data, :subdomain, :authentication, :base_path, :options

      def initialize(http_method, subdomain, api_url, data, options={})
        @http_method = http_method
        @subdomain   = subdomain || DOMAIN_BASE
        @api_url     = api_url
        @data        = data
        @base_path   = API_BASE_PATH
        @authentication = {}
        @authentication[:type] = options.delete(:auth_type)
        @authentication[:token] = options.delete(:auth_token)
        @options = options
      end

      def url
        url = "/#{base_path}/#{api_url}"
        if has_id?
          url += "/#{data[:id]}"
          data.delete(:id)
        end

        url
      end

      def path_with_params(path, params)
        unless params.empty?
          encoded_params = URI.encode_www_form(params)
          [path, encoded_params].join("?")
        else
          path
        end
      end

      def use_form_data?
        (options || {}).fetch(:use_form_data, false)
      end

      protected

      def has_id?
        !data[:id].nil?
      end
    end
  end
end<commit_msg>Fixed specs<commit_after>module Signnow
  module Request
    class Info
      attr_accessor :http_method, :api_url, :data, :subdomain, :authentication, :base_path, :options

      def initialize(http_method, subdomain, api_url, data, options={})
        @http_method = http_method
        @subdomain   = subdomain || DOMAIN_BASE
        @api_url     = api_url
        @data        = data
        @base_path   = API_BASE_PATH
        @authentication = {}
        @authentication[:type] = options.delete(:auth_type)
        @authentication[:token] = options.delete(:auth_token)
        @options = options
      end

      def url
        url = "/#{base_path}/#{api_url}"
        if has_id?
          url += "/#{data[:id]}"
          data.delete(:id)
        end

        url
      end

      def path_with_params(path, params)
        unless params.empty?
          encoded_params = URI.encode_www_form(params)
          [path, encoded_params].join("?")
        else
          path
        end
      end

      def use_form_data?
        options.fetch(:use_form_data, false)
      end

      protected

      def has_id?
        !data[:id].nil?
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10382978723404256, 'fraction_numerical': 0.0, 'mean_word_length': 1.9168734491315136, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3367175', 'n_tokens_mistral': 721, 'n_tokens_neox': 711, 'n_words': 155}