#sort_by should just take one block parameter, an item from the array, and sorts based on the result of the block.
[1,2,3].sort_by { |x| x } => [1, 2, 3]
[1,2,3].sort_by { |x| -x } => [3, 2, 1]
[1,2,3].sort => [1, 2, 3]
[1,2,3].sort.reverse => [3, 2, 1]
[1,2,3].sort { |x, y| x <=> y } => [1, 2, 3]
[1,2,3].sort { |x, y| y <=> x } => [3, 2, 1]