ztm_warszawa 0.1.1 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c301563b013d2ee822fc408b151cd4dbff77bfd7
4
- data.tar.gz: 84796c618847435c42b7ceb8b52d29193b282ef6
3
+ metadata.gz: edb65a00d5d254953f3e4279c69ad8dbfbc83787
4
+ data.tar.gz: 85b887a46eedad4774862c791426ce347483dfe0
5
5
  SHA512:
6
- metadata.gz: 295e47cfb457797cd9a409a92e520b6f73ab13ead40403db9a0591dcba8a81f7867f9706dfa7e94f04ec5e7c27183ce99b11bd086bf0944ecb6f2843fad3948c
7
- data.tar.gz: 21400e015f9a3ce539a1aeb4afd785c4e9f870c29826a27345a3cbb12a796901ae8117c145edf2e77e90084654fe8d2ceeced4c7f2d2019b9b85e3e352d0e775
6
+ metadata.gz: 0e336a47c5b6a9e7a92f01a2222f9b9150be747d42c040281e453edbada089c690876e1d0c4392929942ee808b402cf55002c7ba61c3d85fefd3e7ecd888ce21
7
+ data.tar.gz: ccc58044bedb352dcf68f8d032bf2d33b4fe59244267a7aa2b51cd4d68b4288dfa9196f266d08b533567b2ff3a05cf69ce53584ef58106c68faa45d3ed23fd14
data/README.md CHANGED
@@ -36,7 +36,9 @@ First, create the the appropriate object:
36
36
 
37
37
  `ztm_api = ZtmWarszawa.new(api_key)`
38
38
 
39
- The API key has to be a string. It can be changed later on by calling `ztm_api.api_key = (new api key)`. You can get an API key by registering [here](https://api.um.warszawa.pl/index.php?wcag=true&opc=8.8,2,0,0,).
39
+ The API key has to be a string. It can be changed later on by calling `ztm_api.api_key = (new api key)`.
40
+
41
+ You can get an API key by registering [here](https://api.um.warszawa.pl/index.php?wcag=true&opc=8.8,2,0,0,).
40
42
 
41
43
  Now, you can use the following methods:
42
44
 
@@ -44,7 +46,9 @@ Now, you can use the following methods:
44
46
 
45
47
  - `get_bus_lines(bus_stop_id, bus_stop_no)`: Returns an array of bus lines (e.g. 527, 141...) that depart from a given bus stop.
46
48
 
47
- - `get_closest_departures(server_response, script_starting_time, bus_line, number_of_departures)`: From the server's response from get_line_departure_hours(), find a given number of closest departures. The result is an array of hashes with "bus_line" and "time" entries.
49
+ - `get_line_departure_hours(bus_stop_id, bus_stop_no, bus_line)`: Returns the server response with all the hours of departure of a given bus line from a given bus stop.
50
+
51
+ - `get_closest_departures(server_response, script_starting_time, bus_line, number_of_departures)`: Given the server's response from `get_line_departure_hours()`, finds a given number of closest departures. The result is an array of hashes with "bus_line" and "time" entries.
48
52
 
49
53
  ## License
50
54
 
@@ -1,3 +1,3 @@
1
1
  class ZtmWarszawa
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.3"
3
3
  end
data/lib/ztm_warszawa.rb CHANGED
@@ -35,7 +35,7 @@ class ZtmWarszawa
35
35
  return bus_lines
36
36
  end
37
37
 
38
- # Returns the server response with all the hours of departure of a given bus line from a given bus stop (and its number).
38
+ # Returns the server response with all the hours of departure of a given bus line from a given bus stop.
39
39
  def get_line_departure_hours(bus_stop_id, bus_stop_no, bus_line)
40
40
  url = "https://api.um.warszawa.pl/api/action/dbtimetable_get?id=e923fa0e-d96c-43f9-ae6e-60518c9f3238&busstopId=#{bus_stop_id}&busstopNr=#{bus_stop_no}&line=#{bus_line}&apikey=#{@api_key}"
41
41
  response = HTTParty.get(url).parsed_response["result"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ztm_warszawa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotr Górni