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
115 116 117 |
# File 'lib/maid/numeric_extensions.rb', line 115 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
101 102 103 |
# File 'lib/maid/numeric_extensions.rb', line 101 def kb self end |
#mb ⇒ Object Also known as: megabytes, megabyte, mB
108 109 110 |
# File 'lib/maid/numeric_extensions.rb', line 108 def mb self * (1024**1) end |
#tb ⇒ Object Also known as: terabytes, terabyte, tB
122 123 124 |
# File 'lib/maid/numeric_extensions.rb', line 122 def tb self * (1024**3) end |