class Point2d::Sort
Public Class Methods
sort(arr)
click to toggle source
# File lib/point2d/sort.rb, line 2 def self.sort(arr) arr.sort do |p1, p2| if (p1.y<=>p2.y)!=0 p1.y<=>p2.y else p1.x<=>p2.x end end end