ratis 2.5.2.1 → 2.5.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/ratis.rb +6 -5
- data/lib/ratis/point_2_point.rb +8 -8
- data/lib/ratis/point_2_point/group.rb +7 -0
- data/lib/ratis/point_2_point/service.rb +7 -0
- data/lib/ratis/point_2_point/standard_response.rb +7 -0
- data/lib/ratis/point_2_point/stop.rb +8 -0
- data/lib/ratis/point_2_point/trip.rb +7 -0
- data/lib/ratis/route_stops.rb +1 -1
- data/lib/ratis/route_stops/stop.rb +4 -0
- data/lib/ratis/version.rb +1 -1
- metadata +10 -9
- data/lib/ratis/schedule.rb +0 -7
- data/lib/ratis/schedule_group.rb +0 -7
- data/lib/ratis/schedule_trip.rb +0 -7
- data/lib/ratis/service.rb +0 -7
- data/lib/ratis/stop.rb +0 -12
data/lib/ratis.rb
CHANGED
@@ -10,15 +10,16 @@ require 'ratis/landmark_category'
|
|
10
10
|
require 'ratis/location'
|
11
11
|
require 'ratis/next_bus'
|
12
12
|
require 'ratis/point_2_point'
|
13
|
+
require 'ratis/point_2_point/standard_response'
|
14
|
+
require 'ratis/point_2_point/group'
|
15
|
+
require 'ratis/point_2_point/trip'
|
16
|
+
require 'ratis/point_2_point/service'
|
17
|
+
require 'ratis/point_2_point/stop'
|
13
18
|
require 'ratis/request'
|
14
19
|
require 'ratis/route'
|
15
20
|
require 'ratis/route_stops'
|
16
|
-
require 'ratis/
|
17
|
-
require 'ratis/schedule_group'
|
21
|
+
require 'ratis/route_stops/stop'
|
18
22
|
require 'ratis/schedule_nearby'
|
19
|
-
require 'ratis/schedule_trip'
|
20
|
-
require 'ratis/service'
|
21
|
-
require 'ratis/stop'
|
22
23
|
require 'ratis/timetable'
|
23
24
|
require 'ratis/walk'
|
24
25
|
|
data/lib/ratis/point_2_point.rb
CHANGED
@@ -3,7 +3,7 @@ module Ratis
|
|
3
3
|
class Point2Point
|
4
4
|
|
5
5
|
def self.where(conditions)
|
6
|
-
routes_only = conditions.delete(:routes_only)
|
6
|
+
routes_only = conditions.delete(:routes_only) || 'N'
|
7
7
|
|
8
8
|
origin_lat = conditions.delete(:origin_lat).to_f
|
9
9
|
origin_long = conditions.delete(:origin_long).to_f
|
@@ -11,7 +11,7 @@ module Ratis
|
|
11
11
|
destination_long = conditions.delete(:destination_long).to_f
|
12
12
|
|
13
13
|
date = conditions.delete :date
|
14
|
-
start_time = conditions.delete
|
14
|
+
start_time = conditions.delete(:start_time)
|
15
15
|
end_time = conditions.delete :end_time
|
16
16
|
|
17
17
|
raise ArgumentError.new("You must specify routes only with true, false, 'y' or 'n'") unless routes_only.y_or_n rescue false
|
@@ -44,7 +44,7 @@ module Ratis
|
|
44
44
|
|
45
45
|
def self.parse_routes_only_yes(response)
|
46
46
|
response.to_array(:point2point_response, :routes, :service).map do |service|
|
47
|
-
atis_service =
|
47
|
+
atis_service = Point2Point::RoutesOnlyResponse.new
|
48
48
|
atis_service.route = service[:route]
|
49
49
|
atis_service.direction = service[:direction]
|
50
50
|
atis_service.service_type = service[:servicetype]
|
@@ -57,9 +57,9 @@ module Ratis
|
|
57
57
|
def self.parse_routes_only_no(response)
|
58
58
|
return nil unless response.success?
|
59
59
|
|
60
|
-
atis_schedule =
|
60
|
+
atis_schedule = Point2Point::StandardResponse.new
|
61
61
|
atis_schedule.groups = response.to_array(:point2point_response, :groups, :group).map do |group|
|
62
|
-
atis_schedule_group =
|
62
|
+
atis_schedule_group = Point2Point::Group.new
|
63
63
|
|
64
64
|
# Point2point 1.3 uses inconsistent tag naming, thus: <onstop> <onwalk...>, but <offstop> <offstopwalk...>
|
65
65
|
# this docs says this is fixed in 1.4, so watch out
|
@@ -67,12 +67,12 @@ module Ratis
|
|
67
67
|
atis_schedule_group.off_stop = atis_stop_from_hash 'offstop', group[:offstop]
|
68
68
|
|
69
69
|
atis_schedule_group.trips = group.to_array(:trips, :trip).map do |trip|
|
70
|
-
atis_trip =
|
70
|
+
atis_trip = Point2Point::Trip.new
|
71
71
|
atis_trip.on_time = trip[:ontime]
|
72
72
|
atis_trip.off_time = trip[:offtime]
|
73
73
|
|
74
74
|
atis_trip.service = trip.to_array(:service).map do |service|
|
75
|
-
atis_service = Service.new
|
75
|
+
atis_service = Point2Point::Service.new
|
76
76
|
|
77
77
|
atis_service.route = service[:route]
|
78
78
|
atis_service.direction = service[:direction]
|
@@ -95,7 +95,7 @@ module Ratis
|
|
95
95
|
def self.atis_stop_from_hash(prefix, stop)
|
96
96
|
return nil if stop.blank?
|
97
97
|
|
98
|
-
atis_stop = Stop.new
|
98
|
+
atis_stop = Point2Point::Stop.new
|
99
99
|
atis_stop.description = stop[:description]
|
100
100
|
atis_stop.atis_stop_id = stop[:atisstopid].to_i
|
101
101
|
atis_stop.latitude = stop[:lat].to_f
|
data/lib/ratis/route_stops.rb
CHANGED
@@ -25,7 +25,7 @@ module Ratis
|
|
25
25
|
return [] unless response.success?
|
26
26
|
|
27
27
|
response.to_hash[:routestops_response][:stops][:stop].map do |s|
|
28
|
-
stop = Stop.new
|
28
|
+
stop = RouteStops::Stop.new
|
29
29
|
stop.description = s[:description]
|
30
30
|
stop.area = s[:area]
|
31
31
|
stop.atis_stop_id = s[:atisstopid]
|
data/lib/ratis/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ratis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 75
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 5
|
9
9
|
- 2
|
10
|
-
-
|
11
|
-
version: 2.5.2.
|
10
|
+
- 2
|
11
|
+
version: 2.5.2.2
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- AuthorityLabs
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2012-08-
|
19
|
+
date: 2012-08-16 00:00:00 Z
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
name: savon
|
@@ -164,16 +164,17 @@ files:
|
|
164
164
|
- lib/ratis/landmark_category.rb
|
165
165
|
- lib/ratis/location.rb
|
166
166
|
- lib/ratis/next_bus.rb
|
167
|
+
- lib/ratis/point_2_point/group.rb
|
168
|
+
- lib/ratis/point_2_point/service.rb
|
169
|
+
- lib/ratis/point_2_point/standard_response.rb
|
170
|
+
- lib/ratis/point_2_point/stop.rb
|
171
|
+
- lib/ratis/point_2_point/trip.rb
|
167
172
|
- lib/ratis/point_2_point.rb
|
168
173
|
- lib/ratis/request.rb
|
169
174
|
- lib/ratis/route.rb
|
175
|
+
- lib/ratis/route_stops/stop.rb
|
170
176
|
- lib/ratis/route_stops.rb
|
171
|
-
- lib/ratis/schedule.rb
|
172
|
-
- lib/ratis/schedule_group.rb
|
173
177
|
- lib/ratis/schedule_nearby.rb
|
174
|
-
- lib/ratis/schedule_trip.rb
|
175
|
-
- lib/ratis/service.rb
|
176
|
-
- lib/ratis/stop.rb
|
177
178
|
- lib/ratis/timetable.rb
|
178
179
|
- lib/ratis/version.rb
|
179
180
|
- lib/ratis/walk.rb
|
data/lib/ratis/schedule.rb
DELETED
data/lib/ratis/schedule_group.rb
DELETED
data/lib/ratis/schedule_trip.rb
DELETED
data/lib/ratis/service.rb
DELETED
data/lib/ratis/stop.rb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
module Ratis
|
2
|
-
|
3
|
-
class Stop
|
4
|
-
|
5
|
-
attr_accessor :description, :atis_stop_id, :latitude, :longitude
|
6
|
-
attr_accessor :walk_dist, :walk_dir, :walk_hint
|
7
|
-
attr_accessor :stop_id, :side, :heading, :stop_position, :route_dir
|
8
|
-
attr_accessor :area, :stop_seq
|
9
|
-
|
10
|
-
end
|
11
|
-
|
12
|
-
end
|