Class: Ach::EntryDetailRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/ach/parser.rb,
lib/ach/creator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ EntryDetailRecord

Returns a new instance of EntryDetailRecord.



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# File 'lib/ach/creator.rb', line 313

def initialize(options = {})
  @record_type = '6'
  @transaction_code = options[:transaction_code]
  @receiving_dfi_routing_num = options[:receiving_dfi_routing_num]
  @receiving_dfi_acc_num = options[:receiving_dfi_acc_num]
  @rt_num_check = options[:rt_num_check]
  @amount = options[:amount]
  @individual_id = options[:individual_id]
  @individual_name = options[:individual_name]
  @routing_number = options[:routing_number]
  @trace_number = options[:trace_number]
  @ach_batch_id = options[:ach_batch_id]
  @settlement_id = options[:settlement_id]
  @db_entry_amount = options[:db_entry_amount]
  @write_to_file = options[:write_to_file]
  encode
end

Instance Attribute Details

#ach_batch_idObject

Returns the value of attribute ach_batch_id.



312
313
314
# File 'lib/ach/creator.rb', line 312

def ach_batch_id
  @ach_batch_id
end

#addenda_record_indicatorObject

Returns the value of attribute addenda_record_indicator.



312
313
314
# File 'lib/ach/creator.rb', line 312

def addenda_record_indicator
  @addenda_record_indicator
end

#amountObject

Returns the value of attribute amount.



311
312
313
# File 'lib/ach/creator.rb', line 311

def amount
  @amount
end

#db_entry_amountObject

Returns the value of attribute db_entry_amount.



312
313
314
# File 'lib/ach/creator.rb', line 312

def db_entry_amount
  @db_entry_amount
end

#disc_dataObject

Returns the value of attribute disc_data.



312
313
314
# File 'lib/ach/creator.rb', line 312

def disc_data
  @disc_data
end

#individual_idObject

Returns the value of attribute individual_id.



311
312
313
# File 'lib/ach/creator.rb', line 311

def individual_id
  @individual_id
end

#individual_nameObject

Returns the value of attribute individual_name.



311
312
313
# File 'lib/ach/creator.rb', line 311

def individual_name
  @individual_name
end

#receiving_dfi_acc_numObject

Returns the value of attribute receiving_dfi_acc_num.



310
311
312
# File 'lib/ach/creator.rb', line 310

def receiving_dfi_acc_num
  @receiving_dfi_acc_num
end

#receiving_dfi_routing_numObject

Returns the value of attribute receiving_dfi_routing_num.



311
312
313
# File 'lib/ach/creator.rb', line 311

def receiving_dfi_routing_num
  @receiving_dfi_routing_num
end

#record_typeObject

Returns the value of attribute record_type.



310
311
312
# File 'lib/ach/creator.rb', line 310

def record_type
  @record_type
end

#routing_numberObject

Returns the value of attribute routing_number.



312
313
314
# File 'lib/ach/creator.rb', line 312

def routing_number
  @routing_number
end

#routing_number_checkObject

Returns the value of attribute routing_number_check.



310
311
312
# File 'lib/ach/creator.rb', line 310

def routing_number_check
  @routing_number_check
end

#rt_num_checkObject

Returns the value of attribute rt_num_check.



310
311
312
# File 'lib/ach/creator.rb', line 310

def rt_num_check
  @rt_num_check
end

#settlement_idObject

Returns the value of attribute settlement_id.



312
313
314
# File 'lib/ach/creator.rb', line 312

def settlement_id
  @settlement_id
end

#trace_numberObject

Returns the value of attribute trace_number.



312
313
314
# File 'lib/ach/creator.rb', line 312

def trace_number
  @trace_number
end

#transaction_codeObject

Returns the value of attribute transaction_code.



310
311
312
# File 'lib/ach/creator.rb', line 310

def transaction_code
  @transaction_code
end

Class Method Details

.decode(record, processor) ⇒ Object



70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/ach/parser.rb', line 70

def self.decode(record)
  ed = {}
  ed[:record_type] = record[0].chr
  ed[:transaction_code] = record[1,2]
  ed[:receiving_dfi_routing_number] = record[3,8]
  ed[:routing_number_check_digit] = record[11,1]
  ed[:receiving_dfi_account_number] = record[12,17]
  ed[:amount] = record[29,10]
  ed[:individual_id] = record[39,15]
  ed[:individual_name] = record[54,22]
  ed[:discretionary_data] = record[76,2]
  ed[:addenda_record_indicator] = record[78,1]
  ed[:trace_number] = record[79,15]
  return ed
end