class Numeric
Some convenient methods for converting bytes to kb, mb, and gb.
Public Instance Methods
to_gb()
click to toggle source
Converts a number to gigabytes.
# File lib/sys/unix/sys/filesystem.rb, line 389 def to_gb self / 1073741824 end
to_kb()
click to toggle source
Converts a number to kilobytes.
# File lib/sys/unix/sys/filesystem.rb, line 379 def to_kb self / 1024 end
to_mb()
click to toggle source
Converts a number to megabytes.
# File lib/sys/unix/sys/filesystem.rb, line 384 def to_mb self / 1048576 end
to_tb()
click to toggle source
Converts a number to terabytes.
# File lib/sys/unix/sys/filesystem.rb, line 394 def to_tb self / 1099511627776 end