module Link

Public Class Methods

tsv_sort(v) click to toggle source
# File lib/rbbt/rest/common/table.rb, line 6
def self.tsv_sort(v)
  value = v.last
  value = value.first if Array === value and value.length == 1
  if String === value and value.match(/<a [^>]*>([^>]*)<\/a>/)
    val = $1
    if val =~ /^\s*\d/
      val.to_f
    else
      1
    end
  elsif Array === value
    value.length
  else
    0
  end
end