Class: Hotfile::Record::BKI61
- Inherits:
-
Hotfile::Record
- Object
- Hotfile::Record
- Hotfile::Record::BKI61
- Defined in:
- lib/hotfile/record/BKI61.rb
Overview
Unticketed Point Information Record ! not tested, I hope this code works at all…
Instance Method Summary collapse
-
#initialize(line) ⇒ BKI61
constructor
A new instance of BKI61.
Constructor Details
#initialize(line) ⇒ BKI61
Returns a new instance of BKI61.
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 |
# File 'lib/hotfile/record/BKI61.rb', line 8 def initialize(line) super segment, arrival_airport, arrival_date, arrival_time, departure_date, departure_time, equipment, reserved = line.scan(/ (\d) ([A-Z0-9 ]{5}) ([A-Z0-9 ]{7}) ([\d ]{5}) ([A-Z0-9 ]{7}) ([\d ]{5}) ([A-Z0-9 ]{3}) (.{63}) /x).flatten @data = { segment: segment.to_i, airport: arrival_airport.strip, departure_datetime: DateTime.parse("#{Hotfile::Date.new(departure_date).to_date} #{departure_time.strip.insert(2, ':')}"), arrival_datetime: DateTime.parse("#{Hotfile::Date.new(arrival_date).to_date} #{arrival_time.strip.insert(2, ':')}"), equipment: equipment.strip, reserved: reserved.strip } end |