atco 1.0.5 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/atco/version.rb +1 -1
- data/lib/atco.rb +9 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4ddb4c619b9d60d92fa99bc37e0df7f1181e5f42d6e001757284077eadbc597b
|
4
|
+
data.tar.gz: d5c8ebaa0bcec7f07a447a78e20d77727926de121616b700103fb06719cd2c1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bae3d2d4b0ace8e394497fba4457f76135940198b10fa05a630ff789efaec217d85cc87406dfca5e338c9aa1e16ee2dd4f62fd039c39066c9235c8b888e9368c
|
7
|
+
data.tar.gz: 44e57ff1c7f56a5b0e1930f2a1fbbd6ec22490fd25608d713f760194520639e509015d38d900587021854d8fbc9160233dbf852d0d1bb2df2d684b3915e18114
|
data/lib/atco/version.rb
CHANGED
data/lib/atco.rb
CHANGED
@@ -38,7 +38,7 @@ module Atco # rubocop:disable Metrics/ModuleLength
|
|
38
38
|
unparsed = []
|
39
39
|
|
40
40
|
data.each_with_index do |line, line_number| # rubocop:disable Metrics/BlockLength
|
41
|
-
if
|
41
|
+
if line_number.zero?
|
42
42
|
header = parse_header(line)
|
43
43
|
next
|
44
44
|
end
|
@@ -52,13 +52,13 @@ module Atco # rubocop:disable Metrics/ModuleLength
|
|
52
52
|
object = send("parse_#{method}", line)
|
53
53
|
next unless object[:record_identity] && object[:record_identity] == identifier
|
54
54
|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
55
|
+
case method
|
56
|
+
when :journey_header
|
57
|
+
current_journey = object
|
58
|
+
when :location
|
59
|
+
current_location = object
|
60
|
+
when :additional_location_info
|
61
|
+
locations << Location.new(current_location, object)
|
62
62
|
end
|
63
63
|
|
64
64
|
if current_journey
|
@@ -73,6 +73,7 @@ module Atco # rubocop:disable Metrics/ModuleLength
|
|
73
73
|
unparsed << { line: line, line_number: line_number }
|
74
74
|
next
|
75
75
|
end
|
76
|
+
objects << object
|
76
77
|
end
|
77
78
|
{ header: header, locations: locations, journeys: journeys, unparsed: unparsed }
|
78
79
|
end
|