Module: Maid::NumericExtensions::SizeToKb
- Defined in:
- lib/maid/numeric_extensions.rb
Instance Method Summary collapse
- #gb ⇒ Object (also: #gigabytes, #gigabyte, #gB)
-
#kb ⇒ Object
(also: #kilobytes, #kilobyte, #kB)
Enables Computer disk size conversion into kilobytes.
- #mb ⇒ Object (also: #megabytes, #megabyte, #mB)
- #tb ⇒ Object (also: #terabytes, #terabyte, #tB)
Instance Method Details
#gb ⇒ Object Also known as: gigabytes, gigabyte, gB
114 115 116 |
# File 'lib/maid/numeric_extensions.rb', line 114 def gb self * 1024 ** 2 end |
#kb ⇒ Object 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 |
#mb ⇒ Object Also known as: megabytes, megabyte, mB
107 108 109 |
# File 'lib/maid/numeric_extensions.rb', line 107 def mb self * 1024 ** 1 end |
#tb ⇒ Object Also known as: terabytes, terabyte, tB
121 122 123 |
# File 'lib/maid/numeric_extensions.rb', line 121 def tb self * 1024 ** 3 end |