Class: Ach::BatchHeaderRecord

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 = {}) ⇒ BatchHeaderRecord

Returns a new instance of BatchHeaderRecord.



240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/ach/creator.rb', line 240

def initialize(options={})
  @record_type = options[:record_type]
  @service_class_code = options[:service_class_code]
  @company_name = options[:company_name]
  @company_discretionary_data = options[:company_discretionary_data]
  @company_id = options[:company_id]
  @sec_code = options[:standard_entry_class_code]
  @company_entry_desc = options[:company_entry_description]
  @company_desc_date = options[:company_descriptive_date]
  @posting_date = options[:effective_entry_date]
  @batch_number = options[:batch_number]
  @originator_status_code = options[:originator_status_code]
  @wellsfargo_routing_number = options[:wellsfargo_routing_number]
  @ach_file_id = options[:ach_file_id]
  @write_to_file = options[:write_to_file]
  @call_encode = encode
end

Instance Attribute Details

#ach_file_idObject

Returns the value of attribute ach_file_id.



239
240
241
# File 'lib/ach/creator.rb', line 239

def ach_file_id
  @ach_file_id
end

#batch_numberObject

Returns the value of attribute batch_number.



238
239
240
# File 'lib/ach/creator.rb', line 238

def batch_number
  @batch_number
end

#call_encodeObject

Returns the value of attribute call_encode.



239
240
241
# File 'lib/ach/creator.rb', line 239

def call_encode
  @call_encode
end

#company_desc_dateObject

Returns the value of attribute company_desc_date.



239
240
241
# File 'lib/ach/creator.rb', line 239

def company_desc_date
  @company_desc_date
end

#company_descriptive_dateObject

Returns the value of attribute company_descriptive_date.



238
239
240
# File 'lib/ach/creator.rb', line 238

def company_descriptive_date
  @company_descriptive_date
end

#company_discretionary_dataObject

Returns the value of attribute company_discretionary_data.



239
240
241
# File 'lib/ach/creator.rb', line 239

def company_discretionary_data
  @company_discretionary_data
end

#company_entry_descObject

Returns the value of attribute company_entry_desc.



237
238
239
# File 'lib/ach/creator.rb', line 237

def company_entry_desc
  @company_entry_desc
end

#company_entry_descriptionObject

Returns the value of attribute company_entry_description.



239
240
241
# File 'lib/ach/creator.rb', line 239

def company_entry_description
  @company_entry_description
end

#company_idObject

Returns the value of attribute company_id.



238
239
240
# File 'lib/ach/creator.rb', line 238

def company_id
  @company_id
end

#company_nameObject

Returns the value of attribute company_name.



237
238
239
# File 'lib/ach/creator.rb', line 237

def company_name
  @company_name
end

#effective_entry_dateObject

Returns the value of attribute effective_entry_date.



238
239
240
# File 'lib/ach/creator.rb', line 238

def 
  @effective_entry_date
end

#originator_status_codeObject

Returns the value of attribute originator_status_code.



238
239
240
# File 'lib/ach/creator.rb', line 238

def originator_status_code
  @originator_status_code
end

#record_typeObject

Returns the value of attribute record_type.



237
238
239
# File 'lib/ach/creator.rb', line 237

def record_type
  @record_type
end

#routing_numberObject

Returns the value of attribute routing_number.



238
239
240
# File 'lib/ach/creator.rb', line 238

def routing_number
  @routing_number
end

#sec_codeObject

Returns the value of attribute sec_code.



237
238
239
# File 'lib/ach/creator.rb', line 237

def sec_code
  @sec_code
end

#service_class_codeObject

Returns the value of attribute service_class_code.



237
238
239
# File 'lib/ach/creator.rb', line 237

def service_class_code
  @service_class_code
end

#settlement_dateObject

Returns the value of attribute settlement_date.



239
240
241
# File 'lib/ach/creator.rb', line 239

def settlement_date
  @settlement_date
end

Class Method Details

.decode(record, processor) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/ach/parser.rb', line 50

def self.decode(record)
  bh = {}
  bh[:record_type] = record[0].chr
  bh[:service_class_code] = record[1,3]
  bh[:company_name] = record[4,16]
  bh[:company_discretionary_data] = record[20,20]
  bh[:company_id] = record[40,10]
  bh[:standard_entry_class_code] = record[50,3]
  bh[:company_entry_description] = record[53,10]
  bh[:company_descriptive_date] = record[63,6]
  bh[:effective_entry_date] = record[69,6]
  bh[:settlement_date] = record[75,3]
  bh[:originator_status_code] = record[78,1]
  bh[:wellsfargo_routing_number] = record[79,8]
  bh[:batch_number] = record[87,7]
  return bh
end