input = {:a=>{:type=>"list", :values=>[{:type=>"b", :id=>"123"}, {:type=>"b", :id=>"456"}]}}
output should be as follows
{:new_name=>"123,456"}
I tried using inject like this.Not sure what to include inside the block
input.tap do |e|
e[:a].try(:[], :values).inject({}) do |h, obj|
h[:new_name] = **
end
end