class Numeric
Some convenient methods for converting bytes to kb, mb, and gb.
Public Instance Methods
<tt>num</tt>.to_gb
click to toggle source
Returns num
in terms of gigabytes.
# File lib/sys/filesystem.rb, line 72 def to_gb self / 1073741824 end
<tt>num</tt>.to_kb
click to toggle source
Returns num
in terms of kilobytes.
# File lib/sys/filesystem.rb, line 56 def to_kb self / 1024 end
<tt>num</tt>.to_mb
click to toggle source
Returns num
in terms of megabytes.
# File lib/sys/filesystem.rb, line 64 def to_mb self / 1048576 end
<tt>num</tt>.to_gb
click to toggle source
Returns num
in terms of terabytes.
# File lib/sys/filesystem.rb, line 80 def to_tb self / 1099511627776 end