Class: Geocoder::Result::HereCalculateRoute
- Inherits:
-
Object
- Object
- Geocoder::Result::HereCalculateRoute
- Defined in:
- lib/geocoder/results/here_calculate_route.rb
Instance Attribute Summary collapse
-
#cache_hit ⇒ Object
true if result came from cache, false if from request to geocoding service; nil if cache is not configured.
-
#data ⇒ Object
data (hash) fetched from geocoding service.
Instance Method Summary collapse
- #base_time ⇒ Object
- #distance ⇒ Object
-
#initialize(data) ⇒ HereCalculateRoute
constructor
Takes a hash of data from a parsed geocoding service response.
- #leg ⇒ Object
- #maneuver ⇒ Object
- #mode ⇒ Object
- #shape ⇒ Object
- #traffic_time ⇒ Object
- #travel_time ⇒ Object
- #waypoint ⇒ Object
Constructor Details
#initialize(data) ⇒ HereCalculateRoute
Takes a hash of data from a parsed geocoding service response.
13 14 15 16 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 13 def initialize(data) @data = data @cache_hit = nil end |
Instance Attribute Details
#cache_hit ⇒ Object
true if result came from cache, false if from request to geocoding service; nil if cache is not configured
8 9 10 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 8 def cache_hit @cache_hit end |
#data ⇒ Object
data (hash) fetched from geocoding service
4 5 6 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 4 def data @data end |
Instance Method Details
#base_time ⇒ Object
50 51 52 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 50 def base_time summary_data['baseTime'] end |
#distance ⇒ Object
38 39 40 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 38 def distance summary_data['distance'] end |
#leg ⇒ Object
22 23 24 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 22 def leg @data['leg'] end |
#maneuver ⇒ Object
30 31 32 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 30 def maneuver leg['maneuver'] end |
#mode ⇒ Object
34 35 36 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 34 def mode @data['mode'] end |
#shape ⇒ Object
26 27 28 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 26 def shape @data['shape'] end |
#traffic_time ⇒ Object
46 47 48 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 46 def traffic_time summary_data['trafficTime'] end |
#travel_time ⇒ Object
42 43 44 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 42 def travel_time summary_data['travelTime'] end |
#waypoint ⇒ Object
18 19 20 |
# File 'lib/geocoder/results/here_calculate_route.rb', line 18 def waypoint @data['waypoint'] end |