I am getting value data: name, uid, high school_name, such a postgraduate school:
Def add_friends facebook.get_connections ("me", "friends" ,: fields = & gt; "name, id, education"). Every do Hash | Hash ['name'] ,: uid = gt; Hash ['id'], highschool_name = & gt; Hash ['education'] ['school'] ['name'] hash ["education"]. Empty?,: Graduate School = Name = & gt; Hash ['Education'] ['School'] ['Name'] Unless that Hush ["Education"] Empty?). "education": [{"school": {"id": "110703012290674", "name" before an array of hash. "" "": "" ":" ":" "" ":" "," Name ":" name ":" name ":" 2009 "}," type ":" high school "}, {" school ": {" id ":" 112812485399398 " Name ":" {10} "," name ":" "," name ":" name ":" name ":" name ":" name ":" 118118634930920 "," name ":" 2012 "}," concentration ": [{" id: ":" 104076956295773 "," name " Computer Science "}]," Type ":" Graduate School "," Classes ": [{" id ":" 1650 93923542525 "," Name ":" Programming "," Details ":" Carson Focusarer PNA Metadars and Techniques with UV webpileup Worked with HVL 5. With ration. "}]}], Edit: This code is docent work. I want to select every high school and graduate school from this array of hash . > High_school = feedback ['education']. Collect {| Ed | | Ed ['school'] ['name'] if ed ['type'] == "high school"} postgraduate = response ['education']. Collect {| Ed | Ed ['School'] ['Name'] If Ed ['Type'] == "Graduate School"}
Comments
Post a Comment