smtuc 0.0.1 → 0.0.2
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/smtuc/line.rb +1 -1
- data/lib/smtuc/stop.rb +2 -2
- data/lib/smtuc.rb +1 -0
- 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: d65d17c96be7adb28ae2a63fde3a90f3617753c0
|
4
|
+
data.tar.gz: 21be799ac1e0f42fec400fb9b01b014c88da5971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c79b98de2a69abad4ddb523a692590952080b3047328a55c21899c456e1b3a22224fb9a0bc8723c845e3f9a19d7cc7fdd3fc672f149e22558d7f9da21e71966
|
7
|
+
data.tar.gz: 66a3bd888c874e621d98bd5fc3c078d1ee6ed549f6a458b1dce65e68751fe30111c775218235b6f5fe53dd57ef965c41ccf6da11a34fbe3ce304271d40a0ecf4
|
data/lib/smtuc/line.rb
CHANGED
@@ -2,7 +2,7 @@ class SMTUC
|
|
2
2
|
class Line
|
3
3
|
attr_accessor :id, :description, :directions
|
4
4
|
|
5
|
-
API_URL =
|
5
|
+
API_URL = "#{BASE_API_URL}/Lines".freeze
|
6
6
|
|
7
7
|
# Directions are returned in a funky format that makes little sense, but
|
8
8
|
# looks like: 'R§Volta§Tovim - Est. Nova'
|
data/lib/smtuc/stop.rb
CHANGED
@@ -5,7 +5,7 @@ class SMTUC
|
|
5
5
|
# This is a bit hacky because the only way to grab all stops is to do a
|
6
6
|
# lat/lon search and expand the range as high as it will go. In theory,
|
7
7
|
# this will return every stop in the system.
|
8
|
-
API_URL =
|
8
|
+
API_URL = "#{BASE_API_URL}/Stops".freeze
|
9
9
|
|
10
10
|
def initialize(attributes)
|
11
11
|
@id = attributes['Code'].gsub('SMTUC_', '')
|
@@ -16,7 +16,7 @@ class SMTUC
|
|
16
16
|
|
17
17
|
# Returns a list of all known stops
|
18
18
|
def self.all
|
19
|
-
response = Faraday.get(API_URL)
|
19
|
+
response = Faraday.get(API_URL + '/GetStops?oLat=40.20343598944182&oLon=-8.417298279776674&meters=99999999999')
|
20
20
|
lines = JSON.parse(response.body)
|
21
21
|
lines.map { |line| new(line) }
|
22
22
|
end
|
data/lib/smtuc.rb
CHANGED