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



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

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



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

def kb
  self
end

#mbObject Also known as: megabytes, megabyte, mB



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

def mb
  self * (1024**1)
end

#tbObject Also known as: terabytes, terabyte, tB



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

def tb
  self * (1024**3)
end