Class: MapQuest::Services::Directions
- Defined in:
- lib/mapquest/services/directions.rb
Overview
The main class used for communicating with the MapQuest Directions API
Defined Under Namespace
Classes: Response
Constant Summary collapse
- API_LOCATION =
:directions
- VALID_OPTIONS =
[:to, :from]
Instance Attribute Summary
Attributes inherited from Core
Instance Method Summary collapse
-
#route(from, to, options = {}) ⇒ Object
Allows you to search for direction to a location.
Methods inherited from Core
Constructor Details
This class inherits a constructor from MapQuest::Services::Core
Instance Method Details
#route(from, to, options = {}) ⇒ Object
Allows you to search for direction to a location. It returns a response object of the route
Example: .route :to => "London, UK", "Manchester, UK"
Required parameters
-
from [String] The location where to end route
-
to [String] The location from which to start route
16 17 18 19 20 21 22 23 24 |
# File 'lib/mapquest/services/directions.rb', line 16 def route(from, to, = {}) if from && to [:to] = to [:from] = from call_api self, 1, 'route', else raise ArgumentError, 'The method must receive the to, and from parameters' end end |