已关闭,此问题需要details or clarity。它目前不接受回答。
**想改善这个问题吗?**通过editing this post添加详细信息并澄清问题。
去年就关门了。
Improve this question
[:sha,"string"]
[:node_id,"dsd"]
[:stats,{:total=>122},:additions=>23],:deletions=>72}]
[:files,[{:sha=>"456"},:filename=>"456"],{:sha=>"123"},:filename=>"123"]]
我想访问sha和stats文件的内容。
client.commit("healtheintent/hcc_reference_service","3a3c56babbc1c77323d178303fa06f8d11e1133d").each do |key,value|
if("#{key}"=="files")
puts ("#{value}")
end
end
现在,values返回文件中的全部内容。类似地,我如何访问stats
1条答案
按热度按时间mfpqipee1#
如何在一般情况下删除哈希
此外,您还可以使用
each_key
或each_value
方法仅覆盖键或值