travel_time 0.5.4 → 0.5.5
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/README.md +104 -104
- data/lib/travel_time/middleware/authentication.rb +1 -1
- 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: 980351a64bc02a09468036537289c94c69e92524ced3303539a4849254f1ad6b
|
4
|
+
data.tar.gz: 70232585d25f0a8dfa63b4f4b4a2fef827381e509ded12f3f641cfff58c88482
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f5c2aec26726acb47a74cfdd6608a0db0243fcfb7fa8c24ab4e86e9bf36bad03294b16bbeb8cbe6d1b1b671c801fb34227a140e1e6053b9612213e12e270d70
|
7
|
+
data.tar.gz: 8c43d33f903df991fa35162d170ef71fa9ebb44cf21dd1570e718ae8e6adf98bbf825117dc4235dc38b843a4956f664f62e42968f03fb98461082569af78336d
|
data/README.md
CHANGED
@@ -215,77 +215,6 @@ response = client.time_filter(
|
|
215
215
|
puts response.body
|
216
216
|
```
|
217
217
|
|
218
|
-
### [Routes](https://traveltime.com/docs/api/reference/routes)
|
219
|
-
Returns routing information between source and destinations.
|
220
|
-
|
221
|
-
Body attributes:
|
222
|
-
* locations: Locations to use. Each location requires an id and lat/lng values.
|
223
|
-
* departure_searches: Searches based on departure times. Leave departure location at no earlier than given time. You can define a maximum of 10 searches.
|
224
|
-
* arrival_searches: Searches based on arrival times. Arrive at destination location at no later than given time. You can define a maximum of 10 searches.
|
225
|
-
|
226
|
-
```ruby
|
227
|
-
require 'time'
|
228
|
-
|
229
|
-
locations = [{
|
230
|
-
id: 'London center',
|
231
|
-
coords: {
|
232
|
-
lat: 51.508930,
|
233
|
-
lng: -0.131387
|
234
|
-
}
|
235
|
-
},
|
236
|
-
{
|
237
|
-
id: 'Hyde Park',
|
238
|
-
coords: {
|
239
|
-
lat: 51.508824,
|
240
|
-
lng: -0.167093
|
241
|
-
}
|
242
|
-
},
|
243
|
-
{
|
244
|
-
id: 'ZSL London Zoo',
|
245
|
-
coords: {
|
246
|
-
lat: 51.536067,
|
247
|
-
lng: -0.153596
|
248
|
-
}
|
249
|
-
}]
|
250
|
-
|
251
|
-
departure_search = {
|
252
|
-
id: 'forward search example',
|
253
|
-
departure_location_id: 'London center',
|
254
|
-
arrival_location_ids: ['Hyde Park', 'ZSL London Zoo'],
|
255
|
-
transportation: {
|
256
|
-
type: 'bus'
|
257
|
-
},
|
258
|
-
departure_time: Time.now.iso8601,
|
259
|
-
travel_time: 1800,
|
260
|
-
properties: ['travel_time'],
|
261
|
-
range: {
|
262
|
-
enabled: true,
|
263
|
-
max_results: 3,
|
264
|
-
width: 600
|
265
|
-
}
|
266
|
-
}
|
267
|
-
|
268
|
-
arrival_search = {
|
269
|
-
id: 'backward search example',
|
270
|
-
departure_location_ids: ['Hyde Park', 'ZSL London Zoo'],
|
271
|
-
arrival_location_id: 'London center',
|
272
|
-
transportation: {
|
273
|
-
type: 'public_transport'
|
274
|
-
},
|
275
|
-
arrival_time: Time.now.iso8601,
|
276
|
-
travel_time: 1800,
|
277
|
-
properties: ['travel_time', 'distance', 'fares', 'route']
|
278
|
-
}
|
279
|
-
|
280
|
-
response = client.routes(
|
281
|
-
locations: locations,
|
282
|
-
departure_searches: [departure_search],
|
283
|
-
arrival_searches: [arrival_search]
|
284
|
-
)
|
285
|
-
|
286
|
-
puts response.body
|
287
|
-
```
|
288
|
-
|
289
218
|
### [Time Filter (Fast)](https://traveltime.com/docs/api/reference/time-filter-fast)
|
290
219
|
A very fast version of `time_filter()`.
|
291
220
|
However, the request parameters are much more limited.
|
@@ -386,8 +315,95 @@ puts(response.body)
|
|
386
315
|
|
387
316
|
The responses are in the form of a list where each position denotes either a travel time (in seconds) of a journey, or if negative that the journey from the origin to the destination point is impossible.
|
388
317
|
|
389
|
-
### [
|
390
|
-
|
318
|
+
### [Routes](https://traveltime.com/docs/api/reference/routes)
|
319
|
+
Returns routing information between source and destinations.
|
320
|
+
|
321
|
+
Body attributes:
|
322
|
+
* locations: Locations to use. Each location requires an id and lat/lng values.
|
323
|
+
* departure_searches: Searches based on departure times. Leave departure location at no earlier than given time. You can define a maximum of 10 searches.
|
324
|
+
* arrival_searches: Searches based on arrival times. Arrive at destination location at no later than given time. You can define a maximum of 10 searches.
|
325
|
+
|
326
|
+
```ruby
|
327
|
+
require 'time'
|
328
|
+
|
329
|
+
locations = [{
|
330
|
+
id: 'London center',
|
331
|
+
coords: {
|
332
|
+
lat: 51.508930,
|
333
|
+
lng: -0.131387
|
334
|
+
}
|
335
|
+
},
|
336
|
+
{
|
337
|
+
id: 'Hyde Park',
|
338
|
+
coords: {
|
339
|
+
lat: 51.508824,
|
340
|
+
lng: -0.167093
|
341
|
+
}
|
342
|
+
},
|
343
|
+
{
|
344
|
+
id: 'ZSL London Zoo',
|
345
|
+
coords: {
|
346
|
+
lat: 51.536067,
|
347
|
+
lng: -0.153596
|
348
|
+
}
|
349
|
+
}]
|
350
|
+
|
351
|
+
departure_search = {
|
352
|
+
id: 'forward search example',
|
353
|
+
departure_location_id: 'London center',
|
354
|
+
arrival_location_ids: ['Hyde Park', 'ZSL London Zoo'],
|
355
|
+
transportation: {
|
356
|
+
type: 'bus'
|
357
|
+
},
|
358
|
+
departure_time: Time.now.iso8601,
|
359
|
+
travel_time: 1800,
|
360
|
+
properties: ['travel_time'],
|
361
|
+
range: {
|
362
|
+
enabled: true,
|
363
|
+
max_results: 3,
|
364
|
+
width: 600
|
365
|
+
}
|
366
|
+
}
|
367
|
+
|
368
|
+
arrival_search = {
|
369
|
+
id: 'backward search example',
|
370
|
+
departure_location_ids: ['Hyde Park', 'ZSL London Zoo'],
|
371
|
+
arrival_location_id: 'London center',
|
372
|
+
transportation: {
|
373
|
+
type: 'public_transport'
|
374
|
+
},
|
375
|
+
arrival_time: Time.now.iso8601,
|
376
|
+
travel_time: 1800,
|
377
|
+
properties: ['travel_time', 'distance', 'fares', 'route']
|
378
|
+
}
|
379
|
+
|
380
|
+
response = client.routes(
|
381
|
+
locations: locations,
|
382
|
+
departure_searches: [departure_search],
|
383
|
+
arrival_searches: [arrival_search]
|
384
|
+
)
|
385
|
+
|
386
|
+
puts response.body
|
387
|
+
```
|
388
|
+
|
389
|
+
### [Geocoding (Search)](https://traveltime.com/docs/api/reference/geocoding-search)
|
390
|
+
Match a query string to geographic coordinates.
|
391
|
+
|
392
|
+
```ruby
|
393
|
+
response = client.geocoding(query: 'London', within_country: 'GB')
|
394
|
+
puts response.body
|
395
|
+
```
|
396
|
+
|
397
|
+
### [Reverse Geocoding](https://traveltime.com/docs/api/reference/geocoding-reverse)
|
398
|
+
Attempt to match a latitude, longitude pair to an address.
|
399
|
+
|
400
|
+
```ruby
|
401
|
+
response = client.reverse_geocoding(lat: 51.506756, lng: -0.128050)
|
402
|
+
puts response.body
|
403
|
+
```
|
404
|
+
|
405
|
+
### [Time Filter (Postcodes)](https://traveltime.com/docs/api/reference/postcode-search)
|
406
|
+
Find reachable postcodes from origin (or to destination) and get statistics about such postcodes.
|
391
407
|
Currently only supports United Kingdom.
|
392
408
|
|
393
409
|
```ruby
|
@@ -399,8 +415,7 @@ departure_search = {
|
|
399
415
|
travel_time: 1800,
|
400
416
|
coords: { lat: 51.507609, lng: -0.128315 },
|
401
417
|
transportation: { type: 'public_transport' },
|
402
|
-
properties: ['
|
403
|
-
reachable_postcodes_threshold: 0.1
|
418
|
+
properties: ['travel_time', 'distance']
|
404
419
|
}
|
405
420
|
|
406
421
|
arrival_search = {
|
@@ -409,20 +424,19 @@ arrival_search = {
|
|
409
424
|
travel_time: 1800,
|
410
425
|
coords: { lat: 51.507609, lng: -0.128315 },
|
411
426
|
transportation: { type: 'public_transport' },
|
412
|
-
properties: ['
|
413
|
-
reachable_postcodes_threshold: 0.1
|
427
|
+
properties: ['travel_time', 'distance']
|
414
428
|
}
|
415
429
|
|
416
|
-
response = client.
|
417
|
-
departure_searches: [departure_search],
|
430
|
+
response = client.time_filter_postcodes(
|
431
|
+
departure_searches: [departure_search],
|
418
432
|
arrival_searches: [arrival_search]
|
419
433
|
)
|
420
434
|
|
421
435
|
puts response.body
|
422
436
|
```
|
423
437
|
|
424
|
-
### [Time Filter (Postcode
|
425
|
-
Find
|
438
|
+
### [Time Filter (Postcode Districts)](https://traveltime.com/docs/api/reference/postcode-district-filter)
|
439
|
+
Find districts that have a certain coverage from origin (or to destination) and get statistics about postcodes within such districts.
|
426
440
|
Currently only supports United Kingdom.
|
427
441
|
|
428
442
|
```ruby
|
@@ -448,7 +462,7 @@ arrival_search = {
|
|
448
462
|
reachable_postcodes_threshold: 0.1
|
449
463
|
}
|
450
464
|
|
451
|
-
response = client.
|
465
|
+
response = client.time_filter_postcode_districts(
|
452
466
|
departure_searches: [departure_search],
|
453
467
|
arrival_searches: [arrival_search]
|
454
468
|
)
|
@@ -456,8 +470,8 @@ response = client.time_filter_postcode_sectors(
|
|
456
470
|
puts response.body
|
457
471
|
```
|
458
472
|
|
459
|
-
### [Time Filter (
|
460
|
-
Find
|
473
|
+
### [Time Filter (Postcode Sectors)](https://traveltime.com/docs/api/reference/postcode-sector-filter)
|
474
|
+
Find sectors that have a certain coverage from origin (or to destination) and get statistics about postcodes within such sectors.
|
461
475
|
Currently only supports United Kingdom.
|
462
476
|
|
463
477
|
```ruby
|
@@ -469,7 +483,8 @@ departure_search = {
|
|
469
483
|
travel_time: 1800,
|
470
484
|
coords: { lat: 51.507609, lng: -0.128315 },
|
471
485
|
transportation: { type: 'public_transport' },
|
472
|
-
properties: ['
|
486
|
+
properties: ['coverage', 'travel_time_reachable', 'travel_time_all'],
|
487
|
+
reachable_postcodes_threshold: 0.1
|
473
488
|
}
|
474
489
|
|
475
490
|
arrival_search = {
|
@@ -478,33 +493,18 @@ arrival_search = {
|
|
478
493
|
travel_time: 1800,
|
479
494
|
coords: { lat: 51.507609, lng: -0.128315 },
|
480
495
|
transportation: { type: 'public_transport' },
|
481
|
-
properties: ['
|
496
|
+
properties: ['coverage', 'travel_time_reachable', 'travel_time_all'],
|
497
|
+
reachable_postcodes_threshold: 0.1
|
482
498
|
}
|
483
499
|
|
484
|
-
response = client.
|
485
|
-
departure_searches: [departure_search],
|
500
|
+
response = client.time_filter_postcode_sectors(
|
501
|
+
departure_searches: [departure_search],
|
486
502
|
arrival_searches: [arrival_search]
|
487
503
|
)
|
488
504
|
|
489
505
|
puts response.body
|
490
506
|
```
|
491
507
|
|
492
|
-
### [Geocoding (Search)](https://traveltime.com/docs/api/reference/geocoding-search)
|
493
|
-
Match a query string to geographic coordinates.
|
494
|
-
|
495
|
-
```ruby
|
496
|
-
response = client.geocoding(query: 'London', within_country: 'GB')
|
497
|
-
puts response.body
|
498
|
-
```
|
499
|
-
|
500
|
-
### [Reverse Geocoding](https://traveltime.com/docs/api/reference/geocoding-reverse)
|
501
|
-
Attempt to match a latitude, longitude pair to an address.
|
502
|
-
|
503
|
-
```ruby
|
504
|
-
response = client.reverse_geocoding(lat: 51.506756, lng: -0.128050)
|
505
|
-
puts response.body
|
506
|
-
```
|
507
|
-
|
508
508
|
### [Map Info](https://traveltime.com/docs/api/reference/map-info)
|
509
509
|
Get information about currently supported countries.
|
510
510
|
|
@@ -14,7 +14,7 @@ module TravelTime
|
|
14
14
|
def on_request(env)
|
15
15
|
env.request_headers[APP_ID_HEADER] = TravelTime.config.application_id
|
16
16
|
env.request_headers[API_KEY_HEADER] = TravelTime.config.api_key
|
17
|
-
env.request_headers[USER_AGENT] =
|
17
|
+
env.request_headers[USER_AGENT] = "Travel Time Ruby SDK #{TravelTime::VERSION}"
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
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.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- TravelTime Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-03-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-configurable
|