Ruby on rails Rails,在复杂哈希中查找对象

Ruby on rails Rails,在复杂哈希中查找对象,ruby-on-rails,ruby,highrise,Ruby On Rails,Ruby,Highrise,我正在构建一个与Highrise集成的应用程序,目前为止还不错,但是,当尝试导入personHighrise::People时,它会抛出一个类似于以下内容的巨大散列: [ ..., #<Highrise::Person:0x1035084b8 @attributes={"contact_data"=>#<Highrise::Person::ContactData:0x1034f8b30 @attributes={"email_addresses"=>[], "addre

我正在构建一个与Highrise集成的应用程序,目前为止还不错,但是,当尝试导入person
Highrise::People
时,它会抛出一个类似于以下内容的巨大散列:

[ ...,  #<Highrise::Person:0x1035084b8 @attributes={"contact_data"=>#<Highrise::Person::ContactData:0x1034f8b30 @attributes={"email_addresses"=>[], "addresses"=>[], "web_addresses"=>[], "phone_numbers"=>[], "twitter_accounts"=>[], "instant_messengers"=>[]}, @prefix_options={}>, "created_at"=>Sat Nov 28 05:38:26 UTC 2009, "title"=>"president", "updated_at"=>Sat Nov 28 05:38:27 UTC 2009, "background"=>"asdfasdfadsfas", "id"=>27569370, "owner_id"=>nil, "group_id"=>nil, "company_id"=>27569371, "last_name"=>"Doe", "author_id"=>192208, "visible_to"=>"Everyone", "first_name"=>"John"}, @prefix_options={}>, ... ]
如果您的列表是一组人员

yourlist.each do |person|
    puts person.attributes["first_name"]
end
如果此人有属性读取器,即。

您还可以执行以下操作:

@people.each do |person|
    puts person.first_name
end
@people.each do |person|
    puts person.first_name
end