What do you want to save?
Add Code snippet
New code examples in category Ruby
-
Ajay P. Prajapati 2021-08-29 19:24:03
iterating over hash, ruby
# iterating_over_hashes.rb person = {name: 'bob', height: '6 ft', weight: '160 lbs', hair: 'brown'} person.each do |key, value| puts "Bob's #{key} is #{value}" end #Returns #Bob's name is bob #Bob's height is 6 ft #Bob's weight is 160 lbs ... Add solution -
Best helpers
Tushar Diwan
+5
Pinakin
+5
I-love-php
+5
Sinow
+5
Saforrest
+5
Mastersulm
+5
Adam Clowes
+5
RiCo
+5
Any Mouse
+5
Richard D
+5