我有返回下一个哈希对象的 gem
{:response=>"There was an error authenticating the sender account.", :status_code=>401}
在我的 rake 任务中,我试图访问它的属性:
response = my_gem.execute
puts response
puts response.has_key?(:respose)
puts response[:respose]
但我不明白为什么会打印
{:response=>"There was an error authenticating the sender account.", :status_code=>401}
false
为什么我不能使用 response[:respose] 访问 :response 属性?
PS response[response.keys.first] 有效,但这是非常奇怪的解决方案