Class: OSRM::Route
- Inherits:
-
Object
- Object
- OSRM::Route
- Defined in:
- lib/osrm/route.rb
Instance Attribute Summary collapse
-
#distance ⇒ Object
Returns the value of attribute distance.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#geometry ⇒ Object
Returns the value of attribute geometry.
Instance Method Summary collapse
-
#initialize(json = {}) ⇒ Route
constructor
A new instance of Route.
Constructor Details
#initialize(json = {}) ⇒ Route
Returns a new instance of Route.
7 8 9 10 11 |
# File 'lib/osrm/route.rb', line 7 def initialize(json = {}) @geometry = decode_geometry(json[:geometry]) @distance = json[:distance].to_f @duration = json[:duration].to_f end |
Instance Attribute Details
#distance ⇒ Object
Returns the value of attribute distance.
5 6 7 |
# File 'lib/osrm/route.rb', line 5 def distance @distance end |
#duration ⇒ Object
Returns the value of attribute duration.
5 6 7 |
# File 'lib/osrm/route.rb', line 5 def duration @duration end |
#geometry ⇒ Object
Returns the value of attribute geometry.
5 6 7 |
# File 'lib/osrm/route.rb', line 5 def geometry @geometry end |