travel_time 0.7.0 → 0.7.1

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
  SHA256:
3
- metadata.gz: 3dad4d1a6f18d988d831dea4314c3f0f829279ed55448f44c923579fa49d1279
4
- data.tar.gz: 7cfeb8f99c2c2be5145f38db72ba6b6865856d33cf935f401e445ca6d2764a3c
3
+ metadata.gz: f8619a3e6ff8d9ce035fc6555fe3e30a2999a50f3256bc4255d78908c2b907b0
4
+ data.tar.gz: 27fe8e9eb8a094fe7754b96127c50472b97ab6b3df27ea4da5e281bd4167ce1c
5
5
  SHA512:
6
- metadata.gz: 4b256ea7bfccf4754389a66a9e30ae4457838b793b295b5d12832408fa169d4c970443753194c2c54f49a73839a675f4d97005a9d1dc626631ab65a909ae55db
7
- data.tar.gz: 5f79e53285c09f08123d8187f60f35882174663da1b85aa95420669ed87b867cb8024e7e5e5907b67398c8f9db520c7c4beed94afad314cdc82924ecec135a13
6
+ metadata.gz: a86808588adb53628e88bcc812d6bc43526a2abc23c3e777883bd7c5c6a3ab93999117fa01cfec44d7080777d6dfd65dff15411dba53b2eb76a35bcbe2314a2f
7
+ data.tar.gz: '0398e615010b5919ef70dcbfa410226a92c0dd95ed72e99a6127261f302cb9bca12ecd8392c4f4b6b87043e9309cdc92bdab2e4f13dc955ab71ef05f438dff8e'
data/README.md CHANGED
@@ -348,16 +348,13 @@ puts response.body
348
348
  ### [Time Filter Fast (Proto)](https://docs.traveltime.com/api/reference/travel-time-distance-matrix-proto)
349
349
  A fast version of time filter communicating using [protocol buffers](https://github.com/protocolbuffers/protobuf).
350
350
 
351
- The request parameters are much more limited and only travel time is returned. In addition, the results are only approximately correct (95% of the results are guaranteed to be within 5% of the routes returned by regular time filter).
352
-
353
- This inflexibility comes with a benefit of faster response times (Over 5x faster compared to regular time filter) and larger limits on the amount of destination points.
354
-
355
351
  Body attributes:
356
352
  * origin: Origin point.
357
353
  * destinations: Destination points. Cannot be more than 200,000.
358
354
  * country: Return the results that are within the specified country.
359
355
  * transport: Transportation type (string) or Transportation object.
360
356
  * traveltime: Time limit.
357
+ * with_distance: (Optional) If true, returns distances in addition to travel times.
361
358
 
362
359
  ```ruby
363
360
  origin = {
@@ -375,7 +372,8 @@ response = client.time_filter_fast_proto(
375
372
  origin: origin,
376
373
  destinations: destinations,
377
374
  transport: 'driving+ferry',
378
- traveltime: 7200
375
+ traveltime: 7200,
376
+ with_distance: true # To also get distances, optional
379
377
  )
380
378
  puts(response.body)
381
379
  ```
@@ -143,9 +143,12 @@ module TravelTime
143
143
  perform_request { connection.post('time-filter/fast', payload) }
144
144
  end
145
145
 
146
- def time_filter_fast_proto(country:, origin:, destinations:, transport:, traveltime:)
146
+ def time_filter_fast_proto(country:, origin:, destinations:, transport:, traveltime:, with_distance: false)
147
147
  transport_obj = Transport.new(transport)
148
- message = ProtoUtils.make_proto_message(origin, destinations, transport_obj, traveltime)
148
+ properties = if with_distance
149
+ [Com::Igeolise::Traveltime::Rabbitmq::Requests::TimeFilterFastRequest::Property::DISTANCES]
150
+ end
151
+ message = ProtoUtils.make_proto_message(origin, destinations, transport_obj, traveltime, properties: properties)
149
152
  payload = ProtoUtils.encode_proto_message(message)
150
153
  perform_request_proto do
151
154
  proto_connection.post("http://proto.api.traveltimeapp.com/api/v3/#{country}/time-filter/fast/#{transport_obj.url_name}",
@@ -153,18 +156,6 @@ module TravelTime
153
156
  end
154
157
  end
155
158
 
156
- def time_filter_fast_proto_distance(country:, origin:, destinations:, transport:, traveltime:)
157
- transport_obj = Transport.new(transport)
158
- message = ProtoUtils.make_proto_message(origin, destinations, transport_obj, traveltime, properties: [1])
159
- payload = ProtoUtils.encode_proto_message(message)
160
-
161
- # FIXME: proto-with-distance is longer used
162
- perform_request_proto do
163
- proto_connection.post("https://proto-with-distance.api.traveltimeapp.com/api/v3/#{country}/time-filter/fast/#{transport_obj.url_name}",
164
- payload)
165
- end
166
- end
167
-
168
159
  def time_filter_postcodes(departure_searches: nil, arrival_searches: nil)
169
160
  payload = {
170
161
  departure_searches: departure_searches,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TravelTime
4
- VERSION = '0.7.0'
4
+ VERSION = '0.7.1'
5
5
  end
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.7.0
4
+ version: 0.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - TravelTime Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-07-17 00:00:00.000000000 Z
11
+ date: 2025-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-configurable