Class: AchClient::Abstract::AchTransaction
- Inherits:
-
Object
- Object
- AchClient::Abstract::AchTransaction
- Defined in:
- lib/ach_client/providers/abstract/ach_transaction.rb
Overview
Generic representation of a single Ach transaction
Direct Known Subclasses
AchClient::AchWorks::AchTransaction, ICheckGateway::AchTransaction, Sftp::AchTransaction
Class Method Summary collapse
-
.arguments ⇒ Array
instance attributes.
Instance Method Summary collapse
-
#credit? ⇒ Boolean
True if transaction is a credit.
-
#debit? ⇒ Boolean
True if transaction is a debit.
-
#initialize(*arguments) ⇒ AchTransaction
constructor
provider to use with your transaction.
- #send ⇒ Object
Constructor Details
#initialize(*arguments) ⇒ AchTransaction
provider to use with your transaction
45 46 47 48 49 50 51 52 53 |
# File 'lib/ach_client/providers/abstract/ach_transaction.rb', line 45 def initialize(*arguments) args = arguments. self.class.arguments.each do |param| self.instance_variable_set( "@#{param}".to_sym, args[param] ) end end |
Class Method Details
.arguments ⇒ Array
instance attributes
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/ach_client/providers/abstract/ach_transaction.rb', line 10 def self.arguments [ :account_number, :account_type, :amount, :effective_entry_date, :external_ach_id, :memo, :merchant_name, :originator_name, :routing_number, :sec_code, :transaction_type ] end |
Instance Method Details
#credit? ⇒ Boolean
Returns true if transaction is a credit.
61 62 63 |
# File 'lib/ach_client/providers/abstract/ach_transaction.rb', line 61 def credit? transaction_type == AchClient::TransactionTypes::Credit end |
#debit? ⇒ Boolean
Returns true if transaction is a debit.
56 57 58 |
# File 'lib/ach_client/providers/abstract/ach_transaction.rb', line 56 def debit? transaction_type == AchClient::TransactionTypes::Debit end |
#send ⇒ Object
65 66 67 |
# File 'lib/ach_client/providers/abstract/ach_transaction.rb', line 65 def send raise AbstractMethodError end |