Module: Maid::NumericExtensions::SizeToKb

Defined in:
lib/maid/numeric_extensions.rb

Instance Method Summary collapse

Instance Method Details

#gbObject Also known as: gigabytes, gigabyte, gB



114
115
116
# File 'lib/maid/numeric_extensions.rb', line 114

def gb
  self * 1024 ** 2
end

#kbObject Also known as: kilobytes, kilobyte, kB

Enables Computer disk size conversion into kilobytes.

Can convert megabytes, gigabytes and terabytes. Handles full name (megabyte), plural (megabytes) and symobl (mb/mB).

1.megabyte = 1024 kilobytes



100
101
102
# File 'lib/maid/numeric_extensions.rb', line 100

def kb
  self
end

#mbObject Also known as: megabytes, megabyte, mB



107
108
109
# File 'lib/maid/numeric_extensions.rb', line 107

def mb
  self * 1024 ** 1
end

#tbObject Also known as: terabytes, terabyte, tB



121
122
123
# File 'lib/maid/numeric_extensions.rb', line 121

def tb
  self * 1024 ** 3
end