Method: Array#numsort

Defined in:
lib/rwd/ruby.rb

#numsortObject



503
504
505
506
507
508
509
510
511
512
513
514
515
# File 'lib/rwd/ruby.rb', line 503

def numsort
  sort do |a, b|
    a2  = a.to_fs
    b2  = b.to_fs

    if a2.class != b2.class
      a2  = a
      b2  = b
    end

    a2 <=> b2
  end
end