Class: Hotfile::Record::BOH03

Inherits:
Hotfile::Record show all
Defined in:
lib/hotfile/record/BOH03.rb

Overview

(Reporting Agent) Office Header Record

Instance Method Summary collapse

Constructor Details

#initialize(line) ⇒ BOH03

Returns a new instance of BOH03.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/hotfile/record/BOH03.rb', line 7

def initialize(line)
  super

  agent_code, remittance_end_date, currency, location_id, reserved =
    line.scan(/
      (\d{8})
      (\d{6})
      ([A-Z0-9]{4})
      ([A-Z0-9 ]{3})
      (.{102})
    /x).flatten

  @data = {
    currency: currency.strip,
    agent_code: agent_code.to_i,
    remittance_end_date: Hotfile::Date.new(remittance_end_date).to_date,
    location_id: location_id.strip,
    reserved: reserved.strip
  }
end