blob: 97f914f281af1d64f60d5f42e1e4e1e5099e6a10 (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 | module TomTom
  BASE_URL = 'https://api.tomtom.com'
  API_KEY = Rails.application.secrets.tomtom_api_key
  @connection = Faraday.new(
    url: BASE_URL,
    params: {
      key: API_KEY
    }
  ) do |faraday|
    faraday.use FaradayMiddleware::FollowRedirects, limit: 1
    faraday.adapter Faraday.default_adapter
  end
  def self.batch(way_costs)
    TomTom::Batch.new(@connection).batch(way_costs)
  end
end
 |