aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2018-03-12 12:52:45 +0100
committerTeddy Wing2018-03-14 16:38:40 +0100
commite558625cd5e3cad60757a537320eb15f1c045cd0 (patch)
treeeb3f99a9162615b78f7dc581c7c6458b571f6589
parent05d2014dff30901feba5c9aab3e066d89d3771ca (diff)
downloadchouette-core-e558625cd5e3cad60757a537320eb15f1c045cd0.tar.bz2
TomTom::Batch: Rename `#convert_way_costs_for_batch`
Rename to `#convert_way_costs` since this method now lives inside the `TomTom::Batch` class, so that part of the name became redundant. Refs #6095
-rw-r--r--lib/tom_tom/batch.rb4
-rw-r--r--spec/lib/tom_tom/batch_spec.rb4
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/tom_tom/batch.rb b/lib/tom_tom/batch.rb
index f947cced8..913f018b5 100644
--- a/lib/tom_tom/batch.rb
+++ b/lib/tom_tom/batch.rb
@@ -9,7 +9,7 @@ module TomTom
travelMode: 'bus',
routeType: 'shortest'
})
- batch_items = convert_way_costs_for_batch(way_costs).map do |locations|
+ batch_items = convert_way_costs(way_costs).map do |locations|
{
query: "/calculateRoute/#{locations}/json?#{params}"
}
@@ -39,7 +39,7 @@ module TomTom
way_costs
end
- def convert_way_costs_for_batch(way_costs)
+ def convert_way_costs(way_costs)
way_costs.map do |way_cost|
"#{way_cost.departure.lat},#{way_cost.departure.lng}" \
":#{way_cost.arrival.lat},#{way_cost.arrival.lng}"
diff --git a/spec/lib/tom_tom/batch_spec.rb b/spec/lib/tom_tom/batch_spec.rb
index aee1a2f1d..eed8848f0 100644
--- a/spec/lib/tom_tom/batch_spec.rb
+++ b/spec/lib/tom_tom/batch_spec.rb
@@ -1,7 +1,7 @@
RSpec.describe TomTom::Batch do
let(:batch) { TomTom::Batch.new(nil) }
- describe "#convert_way_costs_for_batch" do
+ describe "#convert_way_costs" do
it "turns WayCost points into a collection of colon-separated strings" do
way_costs = [
WayCost.new(
@@ -15,7 +15,7 @@ RSpec.describe TomTom::Batch do
]
expect(
- batch.convert_way_costs_for_batch(way_costs)
+ batch.convert_way_costs(way_costs)
).to eq([
'2,48:3,46',
'-71,42:-71.5,42.9'