Class: Geocoder::Result::HereCalculateRoute

Inherits:
Object
  • Object
show all
Defined in:
lib/geocoder/results/here_calculate_route.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_hitObject

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

#dataObject

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_timeObject



50
51
52
# File 'lib/geocoder/results/here_calculate_route.rb', line 50

def base_time
  summary_data['baseTime']
end

#distanceObject



38
39
40
# File 'lib/geocoder/results/here_calculate_route.rb', line 38

def distance
  summary_data['distance']
end

#legObject



22
23
24
# File 'lib/geocoder/results/here_calculate_route.rb', line 22

def leg
  @data['leg']
end

#maneuverObject



30
31
32
# File 'lib/geocoder/results/here_calculate_route.rb', line 30

def maneuver
  leg['maneuver']
end

#modeObject



34
35
36
# File 'lib/geocoder/results/here_calculate_route.rb', line 34

def mode
  @data['mode']
end

#shapeObject



26
27
28
# File 'lib/geocoder/results/here_calculate_route.rb', line 26

def shape
  @data['shape']
end

#traffic_timeObject



46
47
48
# File 'lib/geocoder/results/here_calculate_route.rb', line 46

def traffic_time
  summary_data['trafficTime']
end

#travel_timeObject



42
43
44
# File 'lib/geocoder/results/here_calculate_route.rb', line 42

def travel_time
  summary_data['travelTime']
end

#waypointObject



18
19
20
# File 'lib/geocoder/results/here_calculate_route.rb', line 18

def waypoint
  @data['waypoint']
end