travel_time 0.3.0 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -11
- data/lib/travel_time/client.rb +5 -4
- data/lib/travel_time/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86bdc1c06c65cf3874d54fed44a36d2c519efb7a63d3519c7bd2bb38ab16b814
|
4
|
+
data.tar.gz: c8dbb3f88c7f07c4abf6321243c19d85ee704f3049e5f9f10105e8b64be1d6cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e225994672641a83d7b014a9b523300b6fd1678a15badce37cec429d2781e44a861cca86d741c469bc75000d2e2eb2f7ee7d7b74279023ff7c7db52e92db0b9b
|
7
|
+
data.tar.gz: f72c3996bf95c9fadf2ce3eecc08e9b0170d0d1dd7d1fb0e6e699fba146180b0d8f22d5e88dc15ffae561f32cc15e547d4238c2e9f6f585a2d52dc2eddb5a8a5
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
[![GitHub Actions CI](https://github.com/traveltime-dev/traveltime-sdk-ruby/workflows/CI/badge.svg)](https://github.com/traveltime-dev/traveltime-sdk-ruby/actions?query=workflow%3ACI)
|
5
5
|
|
6
6
|
|
7
|
-
This open-source library allows you to access [TravelTime API](
|
7
|
+
This open-source library allows you to access [TravelTime API](https://docs.traveltime.com/overview/introduction)
|
8
8
|
endpoints.
|
9
9
|
|
10
10
|
## Installation
|
@@ -37,10 +37,10 @@ end
|
|
37
37
|
After that, you can instantiate a client to initiate the API connection:
|
38
38
|
|
39
39
|
```ruby
|
40
|
-
client =
|
40
|
+
client = TravelTime::Client.new
|
41
41
|
```
|
42
42
|
|
43
|
-
You can then use the
|
43
|
+
You can then use the client to call API endpoints:
|
44
44
|
|
45
45
|
```ruby
|
46
46
|
response = client.map_info
|
@@ -387,13 +387,6 @@ Currently only supports United Kingdom.
|
|
387
387
|
```ruby
|
388
388
|
require 'time'
|
389
389
|
|
390
|
-
TravelTime.configure do |config|
|
391
|
-
config.application_id = 'YOUR_API_ID'
|
392
|
-
config.api_key = 'YOUR_API_KEY'
|
393
|
-
end
|
394
|
-
|
395
|
-
client = TravelTime::Client.new
|
396
|
-
|
397
390
|
departure_search = {
|
398
391
|
id: 'public transport from Trafalgar Square',
|
399
392
|
departure_time: Time.now.iso8601,
|
@@ -494,4 +487,4 @@ a GitHub Action which will push the `.gem` file to [rubygems.org](https://rubyge
|
|
494
487
|
|
495
488
|
## Contributing
|
496
489
|
|
497
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/traveltime-dev/travel_time.
|
490
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/traveltime-dev/travel_time.
|
data/lib/travel_time/client.rb
CHANGED
@@ -43,13 +43,14 @@ module TravelTime
|
|
43
43
|
perform_request { connection.post('supported-locations', { locations: locations }) }
|
44
44
|
end
|
45
45
|
|
46
|
-
def geocoding(query:, within_country: nil, exclude: nil, limit: nil, force_postcode: nil)
|
46
|
+
def geocoding(query:, within_country: nil, exclude: nil, limit: nil, force_postcode: nil, bounds: nil)
|
47
47
|
query = {
|
48
48
|
query: query,
|
49
49
|
'within.country': within_country,
|
50
50
|
'exclude.location.types': exclude,
|
51
51
|
limit: limit,
|
52
|
-
'force.add.postcode': force_postcode
|
52
|
+
'force.add.postcode': force_postcode,
|
53
|
+
bounds: bounds ? bounds.join(',') : nil
|
53
54
|
}.compact
|
54
55
|
perform_request { connection.get('geocoding/search', query) }
|
55
56
|
end
|
@@ -64,14 +65,14 @@ module TravelTime
|
|
64
65
|
perform_request { connection.get('geocoding/reverse', query) }
|
65
66
|
end
|
66
67
|
|
67
|
-
def time_map(departure_searches: nil, arrival_searches: nil, unions: nil, intersections: nil)
|
68
|
+
def time_map(departure_searches: nil, arrival_searches: nil, unions: nil, intersections: nil, format: nil)
|
68
69
|
payload = {
|
69
70
|
departure_searches: departure_searches,
|
70
71
|
arrival_searches: arrival_searches,
|
71
72
|
unions: unions,
|
72
73
|
intersections: intersections
|
73
74
|
}.compact
|
74
|
-
perform_request { connection.post('time-map', payload) }
|
75
|
+
perform_request { connection.post('time-map', payload, { 'Accept' => format }) }
|
75
76
|
end
|
76
77
|
|
77
78
|
def time_filter(locations:, departure_searches: nil, arrival_searches: nil)
|
data/lib/travel_time/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: travel_time
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TravelTime Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|