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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ff1d090978c1caec8da1062e3db14c9385485a0e
4
- data.tar.gz: 8ac4932cebfd9f151194ae61b390609770c28153
3
+ metadata.gz: d65d17c96be7adb28ae2a63fde3a90f3617753c0
4
+ data.tar.gz: 21be799ac1e0f42fec400fb9b01b014c88da5971
5
5
  SHA512:
6
- metadata.gz: 2ad6bcb139a7915cf5aa86ef935f0e45feed2bc95672ce45ea0326549e50153a439d20c995176c4ce78ba1dc2a01e07ee6dcd9c57b5681fbe49a72df18374f7f
7
- data.tar.gz: 54a0c55ac92ab4a32e7e19c98fad5bb4830b62666c4302afb411c66aa44ad2d1235715a4b34afad11005349ccc478bfc7e298851293122181d1500b36b5e7fe4
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 = 'http://coimbra.move-me.mobi/Lines'.freeze
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 = 'http://coimbra.move-me.mobi/Stops/GetStops?oLat=40.20343598944182&oLon=-8.417298279776674&meters=99999999999'.freeze
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
@@ -5,6 +5,7 @@ require 'faraday'
5
5
  require 'json'
6
6
 
7
7
  class SMTUC
8
+ BASE_API_URL = 'http://coimbra.move-me.mobi'.freeze
8
9
  end
9
10
 
10
11
  require 'smtuc/line'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smtuc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fred Oliveira