Implemented selection sort in ruby