我得到一个返回值,如图所示。我认为它有一个包含在哈希等中的数组,
如何访问最里面的网络/数组中的元素? 类似于:p ret [0] .hash.array [0] .hash.array [0] .data我认为我错了解引用哈希。
p ret[0] works by returning me the hash but dont know how to go beyond that
p (ret[0])['network'] doesnt seem to work i think network is not a key, but how do i access that data structure ?
答案 0 :(得分:0)
如果你的返回值是这样的:
ret = [{ 'network' => ['something'] }]
你可以简单地说:
ret[0]['network'] #=> ["something"]