puts yourHash.to_yaml

On Sunday, June 7, 2015 at 3:31:44 AM UTC-4, Mister Reese wrote:
>
> Hi Everyone,
>
> Here is the code I currently have:
>
> contacts = Hash.new
>
> x = 0
> y = 0
>
> if x <= 5
>     puts "What contact would you like to add?"
>     ui = gets.chomp
>     contacts.store(y, ui)
>     puts "Contact added is #{contacts}"
>     x += 1
>     y += 1
>     puts "X is #{x}, Y is #{y}" # so I know if the values are being 
> incremented
> else
>     puts "You've reached the maximum # of contacts."
> end
>
> Also, how can I print a hash to the console without a key value? 
>
> Thank you
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/665f93e9-002a-423f-8ca3-915678346ac1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to