myarray.
sort_by { |h| h['id'][/\d+/].to_i }.
each.
with_index(1) do |h, idx|
puts ["\n", "#{idx})", h['id'], "n.", h['count']].join(' ')
end
2
solved Print an array of hashes ordered by a hash key
myarray.
sort_by { |h| h['id'][/\d+/].to_i }.
each.
with_index(1) do |h, idx|
puts ["\n", "#{idx})", h['id'], "n.", h['count']].join(' ')
end
2
solved Print an array of hashes ordered by a hash key