Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def origin_destination_info(trips)
- origin_code = []
- destination_code = []
- departure_date = []
- arrival_date = []
- [trips].flatten.each do |this|
- origin_code << this[:departure_airport][:@location_code]
- destination_code << this[:arrival_airport][:@location_code]
- departure_date << this[:@departure_date_time]
- arrival_date << this[:@arrival_date_time]
- end
- [origin_code.first, destination_code.first, departure_date.first, arrival_date.first]
- end
- ###########call this function like this
- origin_code, destination_code, departure_date, arrival_date = origin_destination_info(trips)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement