Class: GoogleMapsAPI::Directions::Route

Inherits:
Object
  • Object
show all
Defined in:
lib/google_maps_api/directions/route.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bounds, copyrights, legs, overview_polyline, summary, warnings, waypoint_order) ⇒ Route

Returns a new instance of Route.



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/google_maps_api/directions/route.rb', line 6

def initialize(
  bounds, copyrights, legs, 
  overview_polyline, summary, 
  warnings, waypoint_order
)
  @bounds = bounds
  @copyrights = copyrights
  @legs = legs
  @overview_polyline = overview_polyline
  @summary = summary
  @warnings = warnings
  @waypoint_order = waypoint_order
end

Instance Attribute Details

#boundsObject (readonly)

Returns the value of attribute bounds.



2
3
4
# File 'lib/google_maps_api/directions/route.rb', line 2

def bounds
  @bounds
end

#copyrightsObject (readonly)

Returns the value of attribute copyrights.



2
3
4
# File 'lib/google_maps_api/directions/route.rb', line 2

def copyrights
  @copyrights
end

#legsObject (readonly)

Returns the value of attribute legs.



2
3
4
# File 'lib/google_maps_api/directions/route.rb', line 2

def legs
  @legs
end

#overview_polylineObject (readonly)

Returns the value of attribute overview_polyline.



2
3
4
# File 'lib/google_maps_api/directions/route.rb', line 2

def overview_polyline
  @overview_polyline
end

#summaryObject (readonly)

Returns the value of attribute summary.



2
3
4
# File 'lib/google_maps_api/directions/route.rb', line 2

def summary
  @summary
end

#warningsObject (readonly)

Returns the value of attribute warnings.



2
3
4
# File 'lib/google_maps_api/directions/route.rb', line 2

def warnings
  @warnings
end

#waypoint_orderObject (readonly)

Returns the value of attribute waypoint_order.



2
3
4
# File 'lib/google_maps_api/directions/route.rb', line 2

def waypoint_order
  @waypoint_order
end

Class Method Details

.from_hash(hash) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/google_maps_api/directions/route.rb', line 20

def self.from_hash(hash)
  bounds = build_bounds(hash)
  copyrights = hash["copyrights"]
  legs = build_legs(hash)
  overview_polyline = build_overview_polyline(hash)
  summary = hash["summary"]
  warnings = hash["warnings"]
  waypoint_order = hash["waypoint_order"]

  self.new(
    bounds, copyrights, legs, 
    overview_polyline, summary, 
    warnings, waypoint_order
  )
end