Class: ACH::Record::Entry

Inherits:
Base
  • Object
show all
Defined in:
lib/ach/record/entry.rb

Overview

A subclass of ACH::Record::Base, an Entry appears in an ACH::Batch component. It is the main record for representing a particular transaction.

Fields

  • record_type

  • transaction_code

  • routing_number

  • bank_account

  • amount

  • customer_acct

  • customer_name

  • transaction_type

  • addenda

  • bank_15

Constant Summary collapse

CREDIT_TRANSACTION_CODE_ENDING_DIGITS =
('0'..'4').to_a.freeze

Constants included from Constants

Constants::BATCH_ADDENDA_RECORD_TYPE, Constants::BATCH_CONTROL_RECORD_TYPE, Constants::BATCH_ENTRY_RECORD_TYPE, Constants::BATCH_HEADER_RECORD_TYPE, Constants::BLOCKING_FACTOR, Constants::FILE_CONTROL_RECORD_TYPE, Constants::FILE_HEADER_RECORD_TYPE, Constants::FORMAT_CODE, Constants::RECORD_SIZE, Constants::ROWS_DELIMITER

Instance Method Summary collapse

Methods inherited from Base

#[]=, defaults, fields, #fields, from_s, #initialize, #to_s!

Methods included from Validations

#errors, #valid?

Constructor Details

This class inherits a constructor from ACH::Record::Base

Instance Method Details

#credit?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/ach/record/entry.rb', line 44

def credit?
  CREDIT_TRANSACTION_CODE_ENDING_DIGITS.include? transaction_code.to_s[1..1]
end

#debit?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/ach/record/entry.rb', line 40

def debit?
  !credit?
end