onebusaway_ruby 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/onebusaway_data.rb +180 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3e211a6ee45ed31746a11d8b0e9413325508edf
|
4
|
+
data.tar.gz: 49473cf7bf4d553418567237a3770354464d615f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ca70c011d41d0de32779cdc4ae8017054ea7c4f9e0112fdab4c6fc29a73daa606d1d93c1e70a7ee500776f080a3e7a0e2adb6d239bb49fa93e4eb7082cf0c6f
|
7
|
+
data.tar.gz: 2943e54b625b9e6d4a9508d0cc0c5142041ef9ead30a5fa20ba90dc26d10ca545bbb23fbfc90ad0960b049dae15d3c6298e84e94f0e2af0ba47c69bb0c4b1782
|
@@ -0,0 +1,180 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler/setup'
|
3
|
+
require 'ostruct'
|
4
|
+
require 'representable/json'
|
5
|
+
|
6
|
+
class Agency < OpenStruct
|
7
|
+
attr_accessor :agency_id
|
8
|
+
attr_accessor :private_service
|
9
|
+
attr_accessor :phone
|
10
|
+
attr_accessor :timezone
|
11
|
+
attr_accessor :disclaimer
|
12
|
+
attr_accessor :name
|
13
|
+
attr_accessor :lang
|
14
|
+
attr_accessor :url
|
15
|
+
end
|
16
|
+
|
17
|
+
module AgencyRepresenter
|
18
|
+
include Representable::JSON
|
19
|
+
property :agency_id, as: :id
|
20
|
+
property :private_service, as: :privateService
|
21
|
+
property :phone
|
22
|
+
property :timezone
|
23
|
+
property :disclaimer
|
24
|
+
property :name
|
25
|
+
property :lang
|
26
|
+
property :url
|
27
|
+
end
|
28
|
+
|
29
|
+
class ArrivalAndDeparture < OpenStruct
|
30
|
+
attr_accessor :route_id
|
31
|
+
attr_accessor :route_short_name
|
32
|
+
attr_accessor :trip_id
|
33
|
+
attr_accessor :trip_headsign
|
34
|
+
attr_accessor :stop_id
|
35
|
+
attr_accessor :predicted_arrival_time
|
36
|
+
attr_accessor :predicted_departure_time
|
37
|
+
attr_accessor :scheduled_arrival_time
|
38
|
+
attr_accessor :scheduled_departure_time
|
39
|
+
end
|
40
|
+
|
41
|
+
module ArrivalAndDepartureRepresenter
|
42
|
+
include Representable::JSON
|
43
|
+
property :route_id, as: :routeId
|
44
|
+
property :route_short_name, as: :routeShortName
|
45
|
+
property :trip_id, as: :tripId
|
46
|
+
property :trip_headsign, as: :tripHeadsign
|
47
|
+
property :stop_id, as: :stopId
|
48
|
+
property :predicted_arrival_time, as: :predictedArrivalTime
|
49
|
+
property :predicted_departure_time, as: :predictedDepartureTime
|
50
|
+
property :scheduled_arrival_time, as: :scheduledArrivalTime
|
51
|
+
property :scheduled_departure_time, as: :scheduledDepartureTime
|
52
|
+
end
|
53
|
+
|
54
|
+
class Route < OpenStruct
|
55
|
+
attr_accessor :route_id
|
56
|
+
attr_accessor :text_color
|
57
|
+
attr_accessor :color
|
58
|
+
attr_accessor :description
|
59
|
+
attr_accessor :long_name
|
60
|
+
attr_accessor :short_name
|
61
|
+
attr_accessor :type
|
62
|
+
attr_accessor :agency_id
|
63
|
+
attr_accessor :url
|
64
|
+
end
|
65
|
+
|
66
|
+
module RouteRepresenter
|
67
|
+
include Representable::JSON
|
68
|
+
property :route_id, as: :id
|
69
|
+
property :text_color, as: :textColor
|
70
|
+
property :color
|
71
|
+
property :description
|
72
|
+
property :long_name, as: :longName
|
73
|
+
property :short_name, as: :shortName
|
74
|
+
property :type
|
75
|
+
property :agency_id, as: :agencyId
|
76
|
+
property :url
|
77
|
+
end
|
78
|
+
|
79
|
+
class Stop < OpenStruct
|
80
|
+
attr_accessor :stop_id
|
81
|
+
attr_accessor :lat
|
82
|
+
attr_accessor :lon
|
83
|
+
attr_accessor :direction
|
84
|
+
attr_accessor :name
|
85
|
+
attr_accessor :code
|
86
|
+
attr_accessor :location_type
|
87
|
+
attr_accessor :routes
|
88
|
+
end
|
89
|
+
|
90
|
+
module StopRepresenter
|
91
|
+
include Representable::JSON
|
92
|
+
property :stop_id, as: :id
|
93
|
+
property :lat
|
94
|
+
property :lon
|
95
|
+
property :direction
|
96
|
+
property :name
|
97
|
+
property :code
|
98
|
+
property :location_type, as: :locationType
|
99
|
+
collection :routes, extend: RouteRepresenter, class: Route
|
100
|
+
end
|
101
|
+
|
102
|
+
class ScheduleStopTime < OpenStruct
|
103
|
+
attr_accessor :departure_enabled
|
104
|
+
attr_accessor :arrival_enabled
|
105
|
+
attr_accessor :stop_headsign
|
106
|
+
attr_accessor :arrival_time
|
107
|
+
attr_accessor :service_id
|
108
|
+
attr_accessor :trip_id
|
109
|
+
attr_accessor :departure_time
|
110
|
+
end
|
111
|
+
|
112
|
+
module ScheduleStopTimeRepresenter
|
113
|
+
include Representable::JSON
|
114
|
+
property :departure_enabled, as: :departureEnabled
|
115
|
+
property :arrival_enabled, as: :arrivalEnabled
|
116
|
+
property :stop_headsign , as: :stopHeadsign
|
117
|
+
property :arrival_time, as: :arrivalTime
|
118
|
+
property :service_id, as: :serviceId
|
119
|
+
property :trip_id, as: :tripId
|
120
|
+
property :departure_time, as: :departureTime
|
121
|
+
end
|
122
|
+
|
123
|
+
class StopRouteDirectionSchedule < OpenStruct
|
124
|
+
attr_accessor :trip_headsign
|
125
|
+
attr_accessor :schedule_frequencies
|
126
|
+
attr_accessor :schedule_stop_times
|
127
|
+
end
|
128
|
+
|
129
|
+
module StopRouteDirectionScheduleRepresenter
|
130
|
+
include Representable::JSON
|
131
|
+
property :trip_headsign, as: :tripHeadsign
|
132
|
+
property :schedule_frequencies, as: :scheduleFrequencies
|
133
|
+
collection :schedule_stop_times, as: :scheduleStopTimes, extend: ScheduleStopTimeRepresenter, class: ScheduleStopTime
|
134
|
+
end
|
135
|
+
|
136
|
+
|
137
|
+
class StopRouteSchedule < OpenStruct
|
138
|
+
attr_accessor :route_id
|
139
|
+
attr_accessor :stop_route_direction_schedules
|
140
|
+
end
|
141
|
+
|
142
|
+
module StopRouteScheduleRepresenter
|
143
|
+
include Representable::JSON
|
144
|
+
property :route_id, as: :routeId
|
145
|
+
collection :stop_route_direction_schedules, as: :stopRouteDirectionSchedules, extend: StopRouteDirectionScheduleRepresenter, class: StopRouteDirectionSchedule
|
146
|
+
end
|
147
|
+
|
148
|
+
class StopSchedule < OpenStruct
|
149
|
+
attr_accessor :stop_id
|
150
|
+
attr_accessor :stop_route_schedules
|
151
|
+
end
|
152
|
+
|
153
|
+
module StopScheduleRepresenter
|
154
|
+
include Representable::JSON
|
155
|
+
property :stop_id, as: :stopId
|
156
|
+
collection :stop_route_schedules, as: :stopRouteSchedules, extend: StopRouteScheduleRepresenter, class: StopRouteSchedule
|
157
|
+
end
|
158
|
+
|
159
|
+
class Vehicle < OpenStruct
|
160
|
+
attr_accessor :vehicle_id
|
161
|
+
attr_accessor :last_location_update_time
|
162
|
+
attr_accessor :location
|
163
|
+
attr_accessor :status
|
164
|
+
attr_accessor :last_update_time
|
165
|
+
attr_accessor :trip_id
|
166
|
+
attr_accessor :trip_status
|
167
|
+
attr_accessor :phase
|
168
|
+
end
|
169
|
+
|
170
|
+
module VehicleRepresenter
|
171
|
+
include Representable::JSON
|
172
|
+
property :vehicle_id, as: :vehicleId
|
173
|
+
property :last_location_update_time, as: :lastLocationUpdateTime
|
174
|
+
property :location
|
175
|
+
property :status
|
176
|
+
property :last_update_time, as: :lastUpdateTime
|
177
|
+
property :trip_id, as: :tripId
|
178
|
+
property :trip_status, as: :tripStatus
|
179
|
+
property :phase
|
180
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: onebusaway_ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Faulkenberry
|
@@ -17,6 +17,7 @@ extensions: []
|
|
17
17
|
extra_rdoc_files: []
|
18
18
|
files:
|
19
19
|
- lib/onebusaway.rb
|
20
|
+
- lib/onebusaway_data.rb
|
20
21
|
homepage: http://rubygems.org/gems/onebusaway_ruby
|
21
22
|
licenses:
|
22
23
|
- MIT
|