2015-12-08 94 views
0

我從api獲取以下哈希,需要解析它,以便我可以通過值Southern Company (SO).訪問字段name有什麼令我困惑的是,看起來像一個數組是在哈希內部構建的,有困難解析它。解析哈希和數組

#<OmniAuth::AuthHash _total=1 values=[#<OmniAuth::AuthHash company=#<OmniAuth::AuthHash id=157357 industry="Utilities" name="Southern Company (SO)" size="10,001+ employees" ticker="SCE" type="Public Company"> id=695794923 isCurrent=true startDate=#<OmniAuth::AuthHash month=1 year=2015> summary="•\tDeveloper " title="Jr.Developer">]> 

回答

0

你有沒有試過?:

response['values'][0]['company']['name'] 
+0

奏效,謝謝!! –