Class: Hotfile::Record::BFH01
- Inherits:
-
Hotfile::Record
- Object
- Hotfile::Record
- Hotfile::Record::BFH01
- Defined in:
- lib/hotfile/record/BFH01.rb
Overview
File Header Record
Instance Method Summary collapse
-
#initialize(line) ⇒ BFH01
constructor
A new instance of BFH01.
Constructor Details
#initialize(line) ⇒ BFH01
Returns a new instance of BFH01.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/hotfile/record/BFH01.rb', line 7 def initialize(line) super bsp_id, airline_code, revision, environment, processing_date, processing_time, country, file_sequence, reserved = line.scan(/ ([A-Z0-9]{3}) ([A-Z0-9]{3}) (\d{3}) ([A-Z0-9]{4}) (\d{6}) (\d{4}) ([A-Z]{2}) (\d{6}) (.{92}) /x).flatten @data = { bsp_id: bsp_id, airline_code: airline_code, revision: revision.to_i, environment: environment, processed: DateTime.parse("#{Hotfile::Date.new(processing_date).to_date} #{processing_time.insert(2, ':')}"), country: country, file_sequence: file_sequence.to_i, reserved: reserved.strip } end |