Class: ACH::Entry

Inherits:
Record show all
Defined in:
lib/ach/entry.rb

Constant Summary collapse

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

Constants included from Constants

Constants::BLOCKING_FACTOR, Constants::FORMAT_CODE, Constants::RECORD_SIZE

Instance Method Summary collapse

Methods inherited from Record

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

Methods included from Validations

#errors, #valid?

Constructor Details

This class inherits a constructor from ACH::Record

Instance Method Details

#credit?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/ach/entry.rb', line 27

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

#debit?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/ach/entry.rb', line 23

def debit?
  !credit?
end