I have a call to Companies House API and response I get from API is an array of hashes.
companies = { "total_results" => 2, "items" => [{ "title" => "First company", "date_of_creation" => "2016-11-09", "company_type" => "ltd", "company_number" => "10471071323", "company_status" => "active" }, { "title" => "Second company", "date_of_creation" => "2016-11-09", "company_type" => "ltd", "company_number" => "1047107132", "company_status" => "active" }] } How I can iterate over companies and get a result similar to:
[{ title: "First company", company_number: "10471071323" }, { title: "Second company", company_number: "1047107132" }]