Created
March 16, 2011 20:12
-
-
Save practicingruby/873218 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def distance_to_hotel(day, index) | |
| case | |
| when index >= @grid.size - 1 | |
| '' | |
| when day[:lodgings].empty? | |
| UNKNOWN_DISTANCE | |
| when overnight_transport?(day) | |
| OVERNIGHT_TRANSPORT_LABEL | |
| when day[:arrive] | |
| day[:arrive].distance_from(hotel_location(day) | |
| else | |
| UNKNOWN_DISTANCE | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment