我有此數組:紅寶石 - 我如何可以訪問一個變量
{
:details=> [
{
"account" =>"",
"address" =>"",
"category" =>"send",
"amount" =>0.0,
"fee" =>0.0
},
{
"account" =>"payment",
"address" =>"SXX5kpEyF8w1oK913wVg2ZbJWpLmWnCgAU",
"category" =>"receive",
"amount" =>1.0
}
]
}
我如何可以訪問紅寶石第二個「地址」元素?當我做
address: detail[:address]
我只得到了第一個(裏面是空的)。
這隻適用於下一個地址。 – Anthony 2014-09-19 17:38:28
@安東尼你是什麼意思? – zavg 2014-09-19 17:39:00
@Anthony在帖子作者問第二個「地址」,不是嗎? – zavg 2014-09-19 17:39:42