Class: Mapbox::Directions
- Inherits:
-
Object
- Object
- Mapbox::Directions
- Extended by:
- HashUtils
- Includes:
- APIOperations::Request
- Defined in:
- lib/mapbox/directions.rb
Class Method Summary collapse
Methods included from HashUtils
Methods included from APIOperations::Request
Class Method Details
.directions(waypoints, profile = 'mapbox.driving') ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/mapbox/directions.rb', line 8 def self.directions(waypoints, profile='mapbox.driving') formatted_waypoints = waypoints.map {|p| xy_from_hash(p).join ','}.join ';' return request( :get, "/v4/directions/#{profile}/#{formatted_waypoints}.json", nil) end |