so I know how I can iterate over and make array within hash
travel=["Round Trip Ticket Price:", "Price of Accommodation:", "Number of checked bags:"] (1..3).each_with_object({}) do |trip, travels| puts "Please input the following for trip # #{trip}" travels["trip #{trip}"]= travel.map { |q| print q; gets.chomp.to_f } end ==>{"trip 1"=>[100.0, 50.0, 1.0], "trip 2"=>[200.0, 100.0, 2.0], "trip 3"=>[300.0, 150.0, 3.0]} BUT instead I want to iterate over to make three individual hashes within one array. I want it to look something like this
travels=[{trip_transportation: 100.0, trip_accommodation:50.0, trip_bags:50} {trip_transportation:200.0, trip_accommodation:100.0, trip_2_bags:100} {trip_3_transportation:300.0, trip_accommodation:150.0, trip_3_bags:150}] I am really confused, basically the only thing I want to know how to do is how do I make three separate hashes while using a loop. I want every hash to represent a trip. Is that even possible?
TravelorTripclass.