Skip to content

Instantly share code, notes, and snippets.

@pumpkincouture
Created September 18, 2014 02:28
Show Gist options
  • Save pumpkincouture/51500401ba98693b8ca9 to your computer and use it in GitHub Desktop.
Save pumpkincouture/51500401ba98693b8ca9 to your computer and use it in GitHub Desktop.
def lay_over_two
@origin == "B" && @destination == "Z" || @origin != "A" && @destination != "B" && @destination != "Z"
end
def find_total_price(first_leg, second_leg, third_leg)
if second_leg == []
total_price = first_leg.get_price + third_leg.get_price
elsif second_leg == third_leg
total_price = first_leg.get_price + second_leg.get_price
else
total_price = first_leg.get_price + second_leg.get_price + third_leg.get_price
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment