Answer the question
In order to leave comments, you need to log in
How to add elements from a hash to an array?
As a means of pure rub from a hash of this kind
row = {lk: {id: 181, name: "Client_name"}, lpp: {id: 123, name: "Client_name2"}}
[181,123]
Answer the question
In order to leave comments, you need to log in
row = {lk: {id: 181, name: "Client_name"}, lpp: {id: 123, name: "Client_name2" }}
row.map{ |k, v| v[:id] }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question