cumtd 0.1.2 → 0.1.3
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/route.rb +10 -0
- data/lib/vehicle.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f07c1a759b2a2f98c788dbd74a46628e5a57169
|
4
|
+
data.tar.gz: 6cb6db13739541f68667194460dc46bedb11688d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65acc848848eeeea23130982abaaf635db2d8f5af0727d4e679b8e4ddbe93811bc3a6e37b21618497f03bcbe8940e206eec79e315d57ed0a247a4ec8438f462b
|
7
|
+
data.tar.gz: f15b09ce9c5c0ed7274a8d10a277f76e9e335bbfab1456fad74c2fa846c58f594cb0f8cde5aa4663f0d09e16a0c4df5b7616f2830a2992a3639be4a561903a80
|
data/lib/route.rb
CHANGED
@@ -26,4 +26,14 @@ class Route < CUMTD
|
|
26
26
|
def route_text_color
|
27
27
|
@route_text_color
|
28
28
|
end
|
29
|
+
|
30
|
+
def to_json(*a)
|
31
|
+
{
|
32
|
+
'route_color' => @route_color,
|
33
|
+
'route_id' => @route_id,
|
34
|
+
'route_long_name' => @route_long_name,
|
35
|
+
'route_short_name' => @route_short_name,
|
36
|
+
'route_text_color' => @route_text_color,
|
37
|
+
}.to_json(*a)
|
38
|
+
end
|
29
39
|
end
|
data/lib/vehicle.rb
CHANGED
@@ -43,12 +43,17 @@ class Vehicle < CUMTD
|
|
43
43
|
@last_updated
|
44
44
|
end
|
45
45
|
|
46
|
+
def route
|
47
|
+
@@all_routes.select { |route| route.route_id == self.trip.route_id }
|
48
|
+
end
|
49
|
+
|
46
50
|
def to_json(*a)
|
47
51
|
{
|
48
52
|
'vehicle_id' => @vehicle_id,
|
49
53
|
'lat' => @location[:lat],
|
50
54
|
'lon' => @location[:lon],
|
51
|
-
'trip' => @trip
|
55
|
+
'trip' => @trip,
|
56
|
+
'route' => self.route,
|
52
57
|
}.to_json(*a)
|
53
58
|
end
|
54
59
|
|