Class: Periplus::Route
- Inherits:
-
BingResponse
- Object
- BingResponse
- Periplus::Route
- Defined in:
- lib/periplus/route.rb
Instance Attribute Summary collapse
-
#distance ⇒ Object
Returns the value of attribute distance.
-
#distance_unit ⇒ Object
Returns the value of attribute distance_unit.
-
#duration ⇒ Object
Returns the value of attribute duration.
-
#response ⇒ Object
Returns the value of attribute response.
-
#route ⇒ Object
Returns the value of attribute route.
Instance Method Summary collapse
Methods inherited from BingResponse
Constructor Details
This class inherits a constructor from Periplus::BingResponse
Instance Attribute Details
#distance ⇒ Object
Returns the value of attribute distance.
6 7 8 |
# File 'lib/periplus/route.rb', line 6 def distance @distance end |
#distance_unit ⇒ Object
Returns the value of attribute distance_unit.
7 8 9 |
# File 'lib/periplus/route.rb', line 7 def distance_unit @distance_unit end |
#duration ⇒ Object
Returns the value of attribute duration.
8 9 10 |
# File 'lib/periplus/route.rb', line 8 def duration @duration end |
#response ⇒ Object
Returns the value of attribute response.
5 6 7 |
# File 'lib/periplus/route.rb', line 5 def response @response end |
#route ⇒ Object
Returns the value of attribute route.
9 10 11 |
# File 'lib/periplus/route.rb', line 9 def route @route end |
Instance Method Details
#parse ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/periplus/route.rb', line 11 def parse super() @distance = @primary_resource["travelDistance"] @distance_unit = @primary_resource["distanceUnit"].downcase.to_sym @duration = @primary_resource["travelDuration"] @route = @primary_resource end |