Method: Time.to_unit

Defined in:
lib/rbfind/humansiz.rb

.to_unit(n) ⇒ Object



108
109
110
111
112
113
114
# File 'lib/rbfind/humansiz.rb', line 108

def to_unit n
  u = TIME_UNITS.each_slice 2 do |nam,val|
    break nam if not val or n < val
    n /= val
  end
  "#{n}#{u[0]}"
end