<commit_before>module Balanced
  # A Credit represents a transfer of funds from your Marketplace's
  # escrow account to a Merchant's Account within your Marketplace.
  #
  # By default, a Credit is sent to the most recently added funding
  # destination associated with an Account. You may specify a specific
  # funding source.
  #
  class Credit
    include Balanced::Resource

    def initialize *args
      options = args.last.is_a?(Hash) ? args.pop : {}
      uri = options.fetch(:uri) { self.class.uri }
      bank_account = options.fetch(:bank_account) {}
      amount = args[0] || options.fetch(:amount) { }
      description = args[1] || options.fetch(:description) { nil }

      unless bank_account.nil?
        # Accountless bank account
        attributes = {
            uri: uri,
            amount: amount,
            description: description,
            bank_account: bank_account,
            meta: nil
        }
      else
        meta = args[2] || options.fetch(:meta) { nil }
        destination_uri = args[3] || options.fetch(:destination_uri) { nil }
        appears_on_statement_as = args[4] || options.fetch(:appears_on_statement_as) { nil }
        attributes = {
            uri: uri,
            amount: amount,
            meta: meta,
            description: description,
            destination_uri: destination_uri,
            appears_on_statement_as: appears_on_statement_as<commit_msg>document available options for Balanced::Credit.initialize<commit_after>module Balanced
  # A Credit represents a transfer of funds from your Marketplace's
  # escrow account to a Merchant's Account within your Marketplace.
  #
  # By default, a Credit is sent to the most recently added funding
  # destination associated with an Account. You may specify a specific
  # funding source.
  #
  class Credit
    include Balanced::Resource

    # @param [Array] args
    # @option [String] :uri the uri of the credit, in the case of an update
    # @option [Hash] :bank_account
    # @option [Integer] :amount amount in cents
    # @option [String] :description a text description of the credit
    # @option [String] :appears_on_statement_as
    # @option [Hash] :meta
    # @option [String] :destination_uri the uri of the bank account to credit
    def initialize *args
      options = args.last.is_a?(Hash) ? args.pop : {}
      uri = options.fetch(:uri) { self.class.uri }
      bank_account = options.fetch(:bank_account) {}
      amount = args[0] || options.fetch(:amount) { }
      description = args[1] || options.fetch(:description) { nil }

      unless bank_account.nil?
        # Accountless bank account
        attributes = {
            uri: uri,
            amount: amount,
            description: description,
            bank_account: bank_account,
            meta: nil
        }
      else
        meta = args[2] || options.fetch(:meta) { nil }
        destination_uri = args[3] || options.fetch(:destination_uri) { nil }
        appears_on_statement_as = args[4] || options.fetch(:appears_on_statement_as) { nil }
        attributes = {
            uri: uri,
            amount: amount,
            meta: meta,
            description: description,
            destination_uri: destination_uri,
            appears_on_statement_as: appears_on_statement_as
{'fraction_non_alphanumeric': 0.09126743480897513, 'fraction_numerical': 0.0030321406913280777, 'mean_word_length': 2.502123142250531, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3606556', 'n_tokens_mistral': 890, 'n_tokens_neox': 886, 'n_words': 273}