Created
March 20, 2011 04:23
-
-
Save langsharpe/878071 to your computer and use it in GitHub Desktop.
Unordered Hash in Ruby 1.8
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
a = Hash.new | |
a['key1'] = 'one' | |
a['key0'] = 'zero' | |
a.each_value do |value| | |
puts value | |
end |
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
lang@virtualbox1:~/$ ruby hash.rb | |
zero | |
one |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment