Created
December 29, 2013 20:45
-
-
Save beezeebly/8174642 to your computer and use it in GitHub Desktop.
Ruby: using each with a Hash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
book = { "author" => "J.K. Rowling", | |
"title" => "Harry Potter and the Philosopher's Stone", | |
"isbn" => "9788478888566"} | |
book.each {|key, value| puts "#{key} is #{value}"} | |
# => author is J.K. Rowling | |
# => title is Harry Potter and the Philosopher's Stone | |
# => isbn is 9788478888566 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment