Undefined method when accessing hash element

后端 未结 1 836
小鲜肉
小鲜肉 2021-02-07 13:49

Hash:

p: {:headline=>\"Managing Director at Test company name\", :pid=>\"0tSsRvCR7r\", :first_name=>\"John\", :last_name=>\"Doe\", :industry=>\"Fi         


        
1条回答
  •  暖寄归人
    2021-02-07 14:46

    Try something like this :

    p = {:headline=>"Managing Director at Test company name", :pid=>"0tSsRvCR7r", :first_name=>"John",     :last_name=>"Doe", :industry=>"Financial Services", :summary=>nil,     :public_profile_url=>"http://www.linkedin.com/pub/john-doe/7a/78/606", :distance=>0}
    puts p
    puts p[:pid]
    

    hash docs

    more on hashes

    0 讨论(0)
提交回复
热议问题