I want to specify a custom block method to sort an object array by evaluating two properties. However, after many searches, I didn\'t find to any example without the <=
<=
This will give you ascending order for x then for y:
x
y
points.sort_by{ |p| [p.x, p.y] }