diff options
Diffstat (limited to 'lib/tom_tom/matrix.rb')
| -rw-r--r-- | lib/tom_tom/matrix.rb | 12 | 
1 files changed, 8 insertions, 4 deletions
| diff --git a/lib/tom_tom/matrix.rb b/lib/tom_tom/matrix.rb index 49c000148..71eb6c75d 100644 --- a/lib/tom_tom/matrix.rb +++ b/lib/tom_tom/matrix.rb @@ -15,10 +15,7 @@ module TomTom          req.params[:routeType] = 'shortest'          req.params[:travelMode] = 'bus' -        req.body = { -          origins: points, -          destinations: points -        }.to_json +        req.body = build_request_body(points)        end        extract_costs_to_way_costs!( @@ -69,6 +66,13 @@ module TomTom        end      end +    def build_request_body(points) +      RequestJSONSerializer.dump({ +        origins: points, +        destinations: points +      }) +    end +      def extract_costs_to_way_costs!(way_costs, points, matrix_json)        way_costs = [] | 
