products = Array.new products << {'name'=>'one', 'price'=>100} products << {'name'=>'two', 'price'=>200} products << {'name'=>'three', 'price'=>50} products.sort_by { |p| p['name'] } products.sort_by { |p| p['price'] }
За повече инфо:
http://www.ruby-doc.org/core/classes/Enumerable.html
