這些是紅寶石散列的樣本響應。搜索嵌套散列
如: -
find abcd1234
應該給我
我能找到,但它不是sufficent
我喜歡這些和列表的......響應繼續走下去不同值但結構相同
[
{
"addon_service": {
"id": "-89ab-cdef-0123-456789abcdef",
"name": "heroku-postgresql"
},
"config_vars": [
"FOO",
"BAZ"
],
"created_at": "2012-01-01T12:00:00Z",
"id": "-89ab-cdef-0123-456789abcdef",
"name": "acme-inc-primary-database",
"plan": {
"id": "-89ab-cdef-0123-456789abcdef",
"name": "heroku-postgresql:dev"
},
"app": {
"id"=>"342uo23iu4io23u4oi2u34",
"name"=>"heroku-staging"},
},
"provider_id": "abcd1234",
"updated_at": "2012-01-01T12:00:00Z",
"web_url": "https://postgres.heroku.com/databases/-89ab-cdef-0123-456789abcdef"
} .........
]
任何人都可以知道如何抓住那些?
未定義的方法'provider_id'我不這麼認爲我們可以這樣做 – Gandalf
所以你的數據實際上是一個包含哈希對象或數組的字符串的數組? –
它的散列陣列某物內部像 [{........ }, {......} , ..........等等.... ] – Gandalf