Class: ACH::Records::CtxEntryDetail

Inherits:
EntryDetail show all
Defined in:
lib/ach/records/entry_detail.rb

Constant Summary

Constants inherited from EntryDetail

EntryDetail::CREDIT_RECORD_TRANSACTION_CODE_ENDING_DIGITS

Constants included from FieldIdentifiers

FieldIdentifiers::ENCODING_OPTIONS

Instance Attribute Summary collapse

Attributes inherited from EntryDetail

#sorter

Instance Method Summary collapse

Methods inherited from EntryDetail

#amount_value, #credit?, #debit?

Methods inherited from Record

fields

Methods included from FieldIdentifiers

#const_field, #field, #left_justify, #spaceless_routing_field

Constructor Details

#initializeCtxEntryDetail

Returns a new instance of CtxEntryDetail.



55
56
57
# File 'lib/ach/records/entry_detail.rb', line 55

def initialize
  @addenda = []
end

Instance Attribute Details

#addendaObject (readonly)

Returns the value of attribute addenda.



53
54
55
# File 'lib/ach/records/entry_detail.rb', line 53

def addenda
  @addenda
end

Instance Method Details

#addenda_records?Boolean

Returns:

  • (Boolean)


59
60
61
# File 'lib/ach/records/entry_detail.rb', line 59

def addenda_records?
  return !self.addenda.empty?
end

#to_achObject



63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/ach/records/entry_detail.rb', line 63

def to_ach
  self.addenda_record_indicator = (self.addenda.empty? ? 0 : 1)
  self.number_of_addenda_records = self.addenda.length

  ach_string = super

  self.addenda.each {|a|
    a.entry_detail_sequence_number = self.trace_number
    ach_string << "\r\n" + a.to_ach
  }
  return ach_string
end