class Geocoder::Lookup::HereCalculateRoute
Public Instance Methods
name()
click to toggle source
# File lib/geocoder/lookups/here_calculate_route.rb, line 5 def name "HereCalculateRoute" end
Private Instance Methods
base_query_url(query)
click to toggle source
# File lib/geocoder/lookups/here_calculate_route.rb, line 11 def base_query_url(query) "#{protocol}://route.#{domain}/routing/7.2/calculateroute.json?" end
query_url_params(query)
click to toggle source
Calls superclass method
# File lib/geocoder/lookups/here_calculate_route.rb, line 28 def query_url_params(query) super.merge(query_url_here_options(query)).merge( waypoints_hash(query.to_param) ) end
results(query)
click to toggle source
# File lib/geocoder/lookups/here_calculate_route.rb, line 15 def results(query) return [] unless doc = fetch_data(query) return [] unless doc["response"] && doc["response"]["route"] r = doc["response"]["route"] if r.is_a?(Array) return r else return [] end end
waypoints_hash(waypoints)
click to toggle source
# File lib/geocoder/lookups/here_calculate_route.rb, line 34 def waypoints_hash(waypoints) waypoints.each_with_object({}).with_index do |(point, hash), index| hash["waypoint#{index}"] = point.join(',') end end