菜鸟求教,如何rails从如下数据获取PublicPort和Image等数值列。感谢!
[#"/bin/bash", "Created"=>1427722904, "Image"=>"ddddd:latest", "Names"=>["/clever_pike"], "Ports"=>[{"IP"=>"0.0.0.0", "PrivatePort"=>80, "PublicPort"=>10280, "Type"=>"tcp"}], "Status"=>"Up 10 days", "id"=>"8aba2f87cdf5e5d340f30fef8e5df8f58d990eab1c70583d4fef3a8fa83de3f2"}, @connection=#"/var/run/docker.sock"}>>, #"/bin/bash", "Created"=>1427722902, "Image"=>"bbbbbbb:latest", "Names"=>["/serene_heisenberg"], "Ports"=>[{"IP"=>"0.0.0.0", "PrivatePort"=>80, "PublicPort"=>10180, "Type"=>"tcp"}], "Status"=>"Up 10 days", "id"=>"c95642d254f1b716debbc8f5381b1234aff69c92db87a43e9b6f64216d1471b3"}, @connection=#"/var/run/docker.sock"}>>, #"/bin/bash", "Created"=>1427722900, "Image"=>"xxxxx:latest", "Names"=>["/adoring_franklin"], "Ports"=>[{"IP"=>"0.0.0.0", "PrivatePort"=>80, "PublicPort"=>10080, "Type"=>"tcp"}], "Status"=>"Up 10 days", "id"=>"5583df725fa5917eee6609210fee422d6d1d0059f8a9c630bdbf407d6cd014fc"}, @connection=#"/var/run/docker.sock"}>>]
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
吐槽,你把对象inspect下就贴上来,直接问,真心懒
你也没说你用的什么库,有了库有文档看文档,没文档看源码
也没有上下文,你对象是怎么创建的
关于问题
你获取的信息看起来是在@info实例变量里