Created
August 25, 2010 02:55
-
-
Save johnnygoodman/548759 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
require 'pp' | |
h = { "1"=>"overallconstruct", | |
"2"=> | |
{ "report"=>87396, | |
"modified"=>"2010-08-09 07:44:39", | |
"rawamount"=>"36.00", | |
"category"=>36679, | |
}, | |
"3"=>1523332} | |
array = h.select { |k, v| k == "2" } | |
pp array | |
#=> [["2", | |
{"rawamount"=>"36.00", | |
"modified"=>"2010-08-09 07:44:39", | |
"report"=>87396, | |
"category"=>36679}]] | |
# How can I access the hash inside the returned array? How do I parse down to the second level? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment