Created
September 11, 2014 15:48
-
-
Save pumpkincouture/4c4f03325c6561a46119 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
class Flight | |
attr_accessor :origin, :destination, :departure, :arrival, :price | |
def initialize(list) | |
@origin = list[0] | |
@destination = list[1] | |
@departure = list[2] | |
@arrival = list[3] | |
@price = list[4] | |
end | |
def no_lay_over | |
@origin == "A" && @destination == "Z" | |
end | |
def lay_over_one | |
@origin == "A" && @destination != "Z" | |
end | |
def lay_over_two | |
@origin != "A" && @destination != "Z" | |
end | |
def lay_over_three | |
@origin != "A" && @destination == "Z" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment