foo.sort { |a,b| a.expensive <=> b.expensive } # basic foo.sort_by { |a,b| a.expensive <=> b.expensive } # Schwartz-enabled