Day 34: Studying Hashes

OK, my Book Tracker app is coming along but I am having difficulty getting the hash to output correctly.

I tried one last go at it this morning:

and it resulted in this:

demosthenes131@book_tracker:~/workspace (master) $ ruby test.rb
Do you want to add a book? (yes or no)
yes
Add a book!
Ender
How about a short, one sentence review? (yes or no)
yes
Add your review!
Awesome
Do you want to add a book? (yes or no)
yes
Add a book!
Dresden
How about a short, one sentence review? (yes or no)
yes
Add your review!
Amazing
Do you want to add a book? (yes or no)
no
[“Ender”, “Dresden”]
{“book”=>[[“Ender”, “Dresden”]], “review”=>[[“Awesome”, “Amazing”]]}
book — [[“Ender”, “Dresden”]]
review — [[“Awesome”, “Amazing”]]

Close, but not what I want. Time to look for a solution.

I worked out a simple one to get the look and feel down. Take a look:

demosthenes131@book_tracker:~/workspace (master) $ ruby test.rb
Do you want to add a book? (yes or no)
yes
Add a book!
Ender
How about a short, one sentence review? (yes or no)
yes
Add your review!
Awesome
Do you want to add a book? (yes or no)
yes
Add a book!
Dresden
How about a short, one sentence review? (yes or no)
yes
Add your review!
Amazing
Do you want to add a book? (yes or no)
no
Ender — Awesome
Dresden — Amazing