У меня есть @hash
, который выглядит так:
[1, {:clid=>1, :nvz=>4, :tip=>"IP", :name=>"Mark", :record=>"some text"}]
[2, {:clid=>2, :nvz=>-5, :tip=>"AO", :name=>"Tom", :record=>"another text"}]
[3, {:clid=>3, :nvz=>0, :tip=>"AO", :name=>"Pit", :record=>"another text"}]
Как мне отсортировать этот хэш, чтобы итерации были упорядочены по :nvz
и выглядели так:
[2, {:clid=>2, :nvz=>-5, :tip=>"AO", :name=>"Tom", :record=>"another text"}]
[3, {:clid=>3, :nvz=>0, :tip=>"AO", :name=>"Pit", :record=>"another text"}]
[1, {:clid=>1, :nvz=>4, :tip=>"IP", :name=>"Mark", :record=>"some text"}]