SelectionSort implementation in Ruby