Created
September 30, 2010 07:44
-
-
Save rockydd/604189 to your computer and use it in GitHub Desktop.
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
# h = [["a", 100], ["c", 300], ["d", 400]] 怎么转化成 {"c" => 300, "a" => 100, "d" => 400, "c" => 300 }这样一个hash | |
h.flatten! | |
Hash[*h] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment