ratis 3.1.6 → 3.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +4 -1
- data/lib/ratis/next_bus.rb +14 -37
- data/lib/ratis/next_bus2.rb +3 -0
- data/lib/ratis/version.rb +1 -1
- metadata +4 -4
data/CHANGELOG
CHANGED
@@ -19,4 +19,7 @@
|
|
19
19
|
- Bug Fix: NextBus where was incorrectly sending Time in 12 hour format when ATIS needs it in 24 hour format.
|
20
20
|
|
21
21
|
3.1.6
|
22
|
-
- Added field 'sign' to Ratis::Timetable::Trip, this is the headsign for a bus running a given trip
|
22
|
+
- Added field 'sign' to Ratis::Timetable::Trip, this is the headsign for a bus running a given trip
|
23
|
+
|
24
|
+
3.1.7
|
25
|
+
- Removed to_hash, instead use better named to_hash_for_xml for use with NextRide SMS service end-point
|
data/lib/ratis/next_bus.rb
CHANGED
@@ -95,45 +95,22 @@ module Ratis
|
|
95
95
|
@success
|
96
96
|
end
|
97
97
|
|
98
|
-
#
|
99
|
-
#
|
100
|
-
|
101
|
-
def first_stop_description
|
102
|
-
raise 'Not yet implemented'
|
103
|
-
stops.first ? stops.first[:description] : nil
|
104
|
-
end
|
105
|
-
|
106
|
-
# Details of NextBus instance in a hash.
|
107
|
-
# @return [Hash] NextBus details in a hash.
|
108
|
-
|
109
|
-
def to_hash
|
110
|
-
raise 'Not yet implemented'
|
111
|
-
{ :stopname => first_stop_description,
|
112
|
-
:signs => runs.map { |run| run[:sign] }.uniq,
|
113
|
-
:runs => runs.map do |run|
|
114
|
-
{ :time => run[:estimatedtime],
|
115
|
-
:sign => run[:sign],
|
116
|
-
:adherence => run[:adherence],
|
117
|
-
:route => run[:route]
|
118
|
-
}
|
119
|
-
end
|
120
|
-
}
|
121
|
-
end
|
122
|
-
|
123
|
-
# Details of NextBus instance in a hash to be transformed to xml
|
124
|
-
# @private
|
98
|
+
# Used to create an XML response for the NextBus SMS services which hits
|
99
|
+
# /nextride.xml?stop_id=<STOPID>
|
125
100
|
|
126
101
|
def to_hash_for_xml
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
102
|
+
{ :stopname => @stop[:description],
|
103
|
+
:runs => @services.map do |service|
|
104
|
+
service.trips.map do |trip|
|
105
|
+
|
106
|
+
{ :time => trip.realtime.estimatedtime,
|
107
|
+
:sign => trip.realtime.sign,
|
108
|
+
:adherence => trip.realtime.adherence,
|
109
|
+
:route => trip.realtime.route
|
110
|
+
}
|
111
|
+
end
|
112
|
+
end.flatten
|
113
|
+
|
137
114
|
}
|
138
115
|
end
|
139
116
|
end
|
data/lib/ratis/next_bus2.rb
CHANGED
@@ -54,6 +54,7 @@ module Ratis
|
|
54
54
|
# @return [String] Description of first stop or nil.
|
55
55
|
|
56
56
|
def first_stop_description
|
57
|
+
raise 'Not yet implemented'
|
57
58
|
stops.first ? stops.first[:description] : nil
|
58
59
|
end
|
59
60
|
|
@@ -61,6 +62,7 @@ module Ratis
|
|
61
62
|
# @return [Hash] NextBus details in a hash.
|
62
63
|
|
63
64
|
def to_hash
|
65
|
+
raise 'Not yet implemented'
|
64
66
|
{ :stopname => first_stop_description,
|
65
67
|
:signs => runs.map { |run| run[:sign] }.uniq,
|
66
68
|
:runs => runs.map do |run|
|
@@ -77,6 +79,7 @@ module Ratis
|
|
77
79
|
# @private
|
78
80
|
|
79
81
|
def to_hash_for_xml
|
82
|
+
raise 'Not yet implemented'
|
80
83
|
{ :stopname => first_stop_description,
|
81
84
|
:runs => runs.map do |run|
|
82
85
|
{ :time => run[:estimatedtime],
|
data/lib/ratis/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ratis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 3
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 3.1.
|
9
|
+
- 7
|
10
|
+
version: 3.1.7
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Burst Software
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-06-
|
18
|
+
date: 2013-06-13 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: savon
|