Class: Ach::FileHeaderRecord

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

Returns a new instance of FileHeaderRecord.



183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'lib/ach/creator.rb', line 183

def initialize(options={})
  @record_type = options[:record_type]
  @priority_code = options[:priority_code]
  @routing_number = options[:routing_number]
  @file_id = options[:file_id]
  @record_size = options[:record_size]
  @blocking_factor = options[:blocking_factor]
  @file_creation_date = options[:file_creation_date]
  @file_creation_time = options[:file_creation_time]
  @format_code = options[:format_code]
  @company_name = options[:company_name]
  @bank_name = options[:bank_name]
  @write_to_file = options[:write_to_file]
  @file_id_modifier = options[:file_id_modifier]
  @origination_bank = options[:origination_bank]
  @wellsfargo_routing_number = options[:wellsfargo_routing_number]
  @call_encode = encode
end

Instance Attribute Details

#bankObject

Returns the value of attribute bank.



181
182
183
# File 'lib/ach/creator.rb', line 181

def bank
  @bank
end

#bank_nameObject

Returns the value of attribute bank_name.



181
182
183
# File 'lib/ach/creator.rb', line 181

def bank_name
  @bank_name
end

#blocking_factorObject

Returns the value of attribute blocking_factor.



181
182
183
# File 'lib/ach/creator.rb', line 181

def blocking_factor
  @blocking_factor
end

#call_encodeObject

Returns the value of attribute call_encode.



181
182
183
# File 'lib/ach/creator.rb', line 181

def call_encode
  @call_encode
end

#company_nameObject

Returns the value of attribute company_name.



181
182
183
# File 'lib/ach/creator.rb', line 181

def company_name
  @company_name
end

#file_creation_dateObject

Returns the value of attribute file_creation_date.



182
183
184
# File 'lib/ach/creator.rb', line 182

def file_creation_date
  @file_creation_date
end

#file_creation_timeObject

Returns the value of attribute file_creation_time.



182
183
184
# File 'lib/ach/creator.rb', line 182

def file_creation_time
  @file_creation_time
end

#file_idObject

Returns the value of attribute file_id.



180
181
182
# File 'lib/ach/creator.rb', line 180

def file_id
  @file_id
end

#file_id_modifierObject

Returns the value of attribute file_id_modifier.



180
181
182
# File 'lib/ach/creator.rb', line 180

def file_id_modifier
  @file_id_modifier
end

#format_codeObject

Returns the value of attribute format_code.



181
182
183
# File 'lib/ach/creator.rb', line 181

def format_code
  @format_code
end

#origination_bankObject

Returns the value of attribute origination_bank.



181
182
183
# File 'lib/ach/creator.rb', line 181

def origination_bank
  @origination_bank
end

#priority_codeObject

Returns the value of attribute priority_code.



180
181
182
# File 'lib/ach/creator.rb', line 180

def priority_code
  @priority_code
end

#record_sizeObject

Returns the value of attribute record_size.



180
181
182
# File 'lib/ach/creator.rb', line 180

def record_size
  @record_size
end

#record_typeObject

Returns the value of attribute record_type.



180
181
182
# File 'lib/ach/creator.rb', line 180

def record_type
  @record_type
end

#routing_numberObject

Returns the value of attribute routing_number.



180
181
182
# File 'lib/ach/creator.rb', line 180

def routing_number
  @routing_number
end

Class Method Details

.decode(record, processor) ⇒ Object



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'lib/ach/parser.rb', line 31

def self.decode(record)
  fh = {}
  fh[:record_type] = record[0].chr
  fh[:priority_code] = record[1,2]
  fh[:wellsfargo_routing_number] = record[4,9]
  fh[:file_id] = record[13,10]
  fh[:file_creation_date] = record[23,6]
  fh[:file_creation_time] = record[29,4]
  fh[:file_id_modifier] = record[33,1]
  fh[:record_size] = record[34,3]
  fh[:blocking_factor] = record[37,2]
  fh[:format_code] = record[39,1]
  fh[:origination_bank] = record[40,23]
  fh[:company_name] = record[63,23]
  return fh
end