Ruby Array Sort Method In Js Object Prototype