<commit_before>module PayTrace
  class EmailReceiptRequest
    TRANSACTION_METHOD = "EmailReceipt"
    attr_accessor :email, :transaction_id, :check_id

    def initialize(params = {})
      email, id, id_is_check_id = false
      @email = params[:email]
      @transaction_id = params[:transaction_id]
      @check_id = params[:check_id]
    end

    def set_request(request = nil)
      request ||= PayTrace::API::Request.new
      request.set_param(:method, TRANSACTION_METHOD)
      request.set_param(:check_id, @check_id)
      request.set_param(:transaction_id, @transaction_id)
      request.set_param(:email, @email)

      request
    end

    def send_request(request = nil)
      request ||= set_request

      gateway = PayTrace::API::Gateway.new
      gateway.send_request(request)
    end
  end
end
<commit_msg>Adds docs to email receipt request object.<commit_after>module PayTrace
  # Methods to request an email receipt for a transaction
  class EmailReceiptRequest
    # :nodoc:
    TRANSACTION_METHOD = "EmailReceipt"
    attr_accessor :email, :transaction_id, :check_id
    # :doc:

    # Initializer. Params:
    # *:email* -- the email address to send the receipt to
    # *:transaction_id* -- the transaction ID of the transaction to email
    # *:check_id* -- the check ID of the transaction to email
    # _Note:_ only use *:transaction_id* _or_ *:check_id* -- not both.
    def initialize(params = {})
      email, id, id_is_check_id = false
      @email = params[:email]
      @transaction_id = params[:transaction_id]
      @check_id = params[:check_id]
    end

    # :nodoc:
    def set_request(request = nil)
      request ||= PayTrace::API::Request.new
      request.set_param(:method, TRANSACTION_METHOD)
      request.set_param(:check_id, @check_id)
      request.set_param(:transaction_id, @transaction_id)
      request.set_param(:email, @email)

      request
    end
    # :doc:

    # Sends the request for the transaction. Accepts an existing request object, or creates one if needed.
    def send_request(request = nil)
      request ||= set_request

      gateway = PayTrace::API::Gateway.new
      gateway.send_request(request)
    end
  end
end

{'fraction_non_alphanumeric': 0.09867519415258108, 'fraction_numerical': 0.0, 'mean_word_length': 3.2359767891682787, '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': '6328822', 'n_tokens_mistral': 691, 'n_tokens_neox': 671, 'n_words': 170}