aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tom_tom
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tom_tom')
-rw-r--r--lib/tom_tom/batch.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/tom_tom/batch.rb b/lib/tom_tom/batch.rb
index 913f018b5..6ceb9c226 100644
--- a/lib/tom_tom/batch.rb
+++ b/lib/tom_tom/batch.rb
@@ -23,9 +23,14 @@ module TomTom
}.to_json
end
- response = JSON.parse(response.body)
+ extract_costs_to_way_costs!(
+ way_costs,
+ JSON.parse(response.body)
+ )
+ end
- calculated_routes = response['batchItems']
+ def extract_costs_to_way_costs!(way_costs, batch_json)
+ calculated_routes = batch_json['batchItems']
calculated_routes.each_with_index do |route, i|
next if route['statusCode'] != 200