[Solved] how to retrieve JSON object from the JSON array in ruby


require 'json'
JSON.parse(input)['result'].map do |h|
  [h['instanceName'], h['status']]
end.to_h
#⇒ {
#      "920_ENT_6017" => "RUNNING",
#      "920_JAS_8082" => "RUNNING",
#          "AIS_0005" => "RUNNING",
#  "DEN00KNL_DEP_920" => "RUNNING",
#           "ENT6547" => "STOPPED",
#         "HTML_8792" => "RUNNING",
#          "RTE_0004" => "RUNNING",
#           "ent4563" => "STOPPED",
#           "ent6021" => "RUNNING",
#       "ent6060_Win" => "RUNNING",
#           "ent6327" => "STOPPED",
#           "ent6363" => "STOPPED",
#            "ent790" => "STOPPED",
#           "ent7943" => "STOPPED",
#              "home" => "RUNNING",
#           "wls1213" => "RUNNING"
# }

2

solved how to retrieve JSON object from the JSON array in ruby