Class: Gdirections::Route
- Inherits:
-
Hashie::Mash
- Object
- Hashie::Mash
- Gdirections::Route
- Defined in:
- lib/gdirections.rb
Instance Method Summary collapse
Instance Method Details
#distance_in_miles ⇒ Object
43 44 45 |
# File 'lib/gdirections.rb', line 43 def distance_in_miles (self.route.legs.map{|l| l.duration.value}.inject{|v,l| v+l} / 1610.22).round end |
#legs ⇒ Object
39 40 41 |
# File 'lib/gdirections.rb', line 39 def legs self.route.legs end |
#route ⇒ Object
35 36 37 |
# File 'lib/gdirections.rb', line 35 def route self.routes.first end |
#time_in_minutes ⇒ Object
47 48 49 |
# File 'lib/gdirections.rb', line 47 def time_in_minutes (self.route.legs.map{|l| l.duration.value}.inject{|v,l| v+l} / 60).ceil end |