<commit_before>module PagSeguro
  class PaymentRequest
    class Response
      extend Forwardable

      def_delegators :response, :success?
      attr_reader :response

      def initialize(response)
        @response = response
      end

      def errors
        @errors ||= Errors.new(response)
      end

      def url
        PagSeguro.site_url("#{api_version}/checkout/payment.html?code=#{code}") if code
      end

      def code
        @code ||= response.data.css("checkout > code").text if success?
      end

      def created_at
        @created_at ||= Time.parse(response.data.css("checkout > date").text) if success?
      end

      def api_version
        'v2'
      end
    end
  end
end<commit_msg>Adds doc to api_version method in payments response class<commit_after>module PagSeguro
  class PaymentRequest
    class Response
      extend Forwardable

      def_delegators :response, :success?
      attr_reader :response

      def initialize(response)
        @response = response
      end

      def errors
        @errors ||= Errors.new(response)
      end

      def url
        PagSeguro.site_url("#{api_version}/checkout/payment.html?code=#{code}") if code
      end

      def code
        @code ||= response.data.css("checkout > code").text if success?
      end

      def created_at
        @created_at ||= Time.parse(response.data.css("checkout > date").text) if success?
      end

      # Default PagSeguro API version for payments
      def api_version
        'v2'
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.0868713259307642, 'fraction_numerical': 0.0013063357282821686, 'mean_word_length': 2.2320675105485233, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '661195', 'n_tokens_mistral': 454, 'n_tokens_neox': 438, 'n_words': 117}