Skip to content

Instantly share code, notes, and snippets.

@pumpkincouture
Created September 15, 2014 22:12
Show Gist options
  • Save pumpkincouture/14a0144385821aba1942 to your computer and use it in GitHub Desktop.
Save pumpkincouture/14a0144385821aba1942 to your computer and use it in GitHub Desktop.
def get_flights(file)
flights_array = []
csv_data = CSV.foreach(file) do |row|
if row[1] != nil
flight = Flight.new(row)
flights_array << flight
elsif row.empty?
flights_array << row
end
end
flights_array.shift
flights_array
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment