这是我的问题,我从请求中获取一个变量并将其存储在@response 中。
然后我调试响应,调试(@response),并得到这个输出:
--- !ruby/hash:Hashie::Mash
results:
- !ruby/hash:Hashie::Mash
id: '33098557'
firstName: john
lastName: star
relationship: self
photo: https://foursquare.com/img/blank_boy.png
tips: !ruby/hash:Hashie::Mash
count: 0
lists: !ruby/hash:Hashie::Mash
groups:
- !ruby/hash:Hashie::Mash
type: created
count: 1
items: []
gender: male
homeCity: mexico
bio: ''
contact: !ruby/hash:Hashie::Mash
email: jhon@hotmail.com
unmatched: !ruby/hash:Hashie::Mash
email: []
我可以通过输入@response.results 来获得结果,并对此进行调试:
---
- !ruby/hash:Hashie::Mash
id: '33098557'
firstName: john
lastName: star
relationship: self
photo: https://foursquare.com/img/blank_boy.png
tips: !ruby/hash:Hashie::Mash
count: 0
lists: !ruby/hash:Hashie::Mash
groups:
- !ruby/hash:Hashie::Mash
type: created
count: 1
items: []
gender: male
homeCity: mexico
bio: ''
contact: !ruby/hash:Hashie::Mash
email: jhon@hotmail.com
但我无法获得电子邮件或名字等内部属性,我如何访问这些属性???