Class: GoogleMapsAPI::Directions::Route
- Inherits:
-
Object
- Object
- GoogleMapsAPI::Directions::Route
- Defined in:
- lib/google_maps_api/directions/route.rb
Instance Attribute Summary collapse
-
#bounds ⇒ Object
readonly
Returns the value of attribute bounds.
-
#copyrights ⇒ Object
readonly
Returns the value of attribute copyrights.
-
#legs ⇒ Object
readonly
Returns the value of attribute legs.
-
#overview_polyline ⇒ Object
readonly
Returns the value of attribute overview_polyline.
-
#summary ⇒ Object
readonly
Returns the value of attribute summary.
-
#warnings ⇒ Object
readonly
Returns the value of attribute warnings.
-
#waypoint_order ⇒ Object
readonly
Returns the value of attribute waypoint_order.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(bounds, copyrights, legs, overview_polyline, summary, warnings, waypoint_order) ⇒ Route
constructor
A new instance of Route.
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
#bounds ⇒ Object (readonly)
Returns the value of attribute bounds.
2 3 4 |
# File 'lib/google_maps_api/directions/route.rb', line 2 def bounds @bounds end |
#copyrights ⇒ Object (readonly)
Returns the value of attribute copyrights.
2 3 4 |
# File 'lib/google_maps_api/directions/route.rb', line 2 def copyrights @copyrights end |
#legs ⇒ Object (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_polyline ⇒ Object (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 |
#summary ⇒ Object (readonly)
Returns the value of attribute summary.
2 3 4 |
# File 'lib/google_maps_api/directions/route.rb', line 2 def summary @summary end |
#warnings ⇒ Object (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_order ⇒ Object (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 |