Class: Ach::BatchControlRecord
- Inherits:
-
Object
- Object
- Ach::BatchControlRecord
- Defined in:
- lib/ach/parser.rb,
lib/ach/creator.rb
Instance Attribute Summary collapse
-
#addenda_count ⇒ Object
Returns the value of attribute addenda_count.
-
#batch_number ⇒ Object
Returns the value of attribute batch_number.
-
#company_id ⇒ Object
Returns the value of attribute company_id.
-
#entry_hash ⇒ Object
Returns the value of attribute entry_hash.
-
#msg_authentication_code ⇒ Object
Returns the value of attribute msg_authentication_code.
-
#record_type ⇒ Object
Returns the value of attribute record_type.
-
#routing_num ⇒ Object
Returns the value of attribute routing_num.
-
#service_class_code ⇒ Object
Returns the value of attribute service_class_code.
-
#total_credits ⇒ Object
Returns the value of attribute total_credits.
-
#total_debits ⇒ Object
Returns the value of attribute total_debits.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ BatchControlRecord
constructor
A new instance of BatchControlRecord.
Constructor Details
#initialize(options = {}) ⇒ BatchControlRecord
Returns a new instance of BatchControlRecord.
374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/ach/creator.rb', line 374 def initialize(={}) @record_type = '8' @service_class_code = [:service_class_code] @addenda_count = [:addenda_count] @entry_hash=[:entry_hash] @total_debits = [:total_debits] @total_credits = [:total_credits] @company_id = [:company_id] @routing_num = [:routing_num] @batch_number = [:batch_number] @write_to_file = [:write_to_file] encode end |
Instance Attribute Details
#addenda_count ⇒ Object
Returns the value of attribute addenda_count.
372 373 374 |
# File 'lib/ach/creator.rb', line 372 def addenda_count @addenda_count end |
#batch_number ⇒ Object
Returns the value of attribute batch_number.
373 374 375 |
# File 'lib/ach/creator.rb', line 373 def batch_number @batch_number end |
#company_id ⇒ Object
Returns the value of attribute company_id.
372 373 374 |
# File 'lib/ach/creator.rb', line 372 def company_id @company_id end |
#entry_hash ⇒ Object
Returns the value of attribute entry_hash.
372 373 374 |
# File 'lib/ach/creator.rb', line 372 def entry_hash @entry_hash end |
#msg_authentication_code ⇒ Object
Returns the value of attribute msg_authentication_code.
373 374 375 |
# File 'lib/ach/creator.rb', line 373 def msg_authentication_code @msg_authentication_code end |
#record_type ⇒ Object
Returns the value of attribute record_type.
372 373 374 |
# File 'lib/ach/creator.rb', line 372 def record_type @record_type end |
#routing_num ⇒ Object
Returns the value of attribute routing_num.
373 374 375 |
# File 'lib/ach/creator.rb', line 373 def routing_num @routing_num end |
#service_class_code ⇒ Object
Returns the value of attribute service_class_code.
372 373 374 |
# File 'lib/ach/creator.rb', line 372 def service_class_code @service_class_code end |
#total_credits ⇒ Object
Returns the value of attribute total_credits.
373 374 375 |
# File 'lib/ach/creator.rb', line 373 def total_credits @total_credits end |
#total_debits ⇒ Object
Returns the value of attribute total_debits.
373 374 375 |
# File 'lib/ach/creator.rb', line 373 def total_debits @total_debits end |
Class Method Details
.decode(record, processor) ⇒ Object
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/ach/parser.rb', line 88 def self.decode(record) bcr = {} bcr[:record_type] = record[0].chr bcr[:service_class_code] = record[1,3] bcr[:entry_addenda_count] = record[4,6] bcr[:entry_hash] = record[10,10] bcr[:total_batch_debit_entry_dollar_amount] = record[20,12] bcr[:total_batch_credit_entry_dollar_amount] = record[32,12] bcr[:company_id] = record[44,10] bcr[:message_authentication_code] = record[54,19] bcr[:blank] = record[73,6] bcr[:wellsfargo_routing_number] = record[79,8] bcr[:batch_number] = record[87,7] return bcr end |