I have a hash PAYMENT_TYPES_HASH. Is there a way to create an array from this hash using each without declaring the array before it like a = []?
a = [];
PAYMENT_TYPES_HASH.each {|order| a << [order[:name], order[:id]]}
a
Something like this:
array = PAYMENT_TYPES_HASH.each {|order| do something to return the array}
You should use
#mapmethod: