Class: IECByteSize
Overview
This class is identical to ByteSize[ByteSize.html] except that all formatted output uses the IEC standard unit symbols: KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB.
Examples of use:
IECByteSize.new( 4127 ) #=> (4.03 KiB)
IECByteSize.new( "22 GB" ) #=> (20.49 GiB)
IECByteSize.new( "22 GiB" ) #=> (22 GiB)
IECByteSize.bytes( 42 ) #=> (42 bytes)
IECByteSize.kib( 42 ) #=> (42 KiB)
IECByteSize.mib( 42 ) #=> (42 MiB)
IECByteSize.gib( 42 ) #=> (42 GiB)
IECByteSize.tib( 42 ) #=> (42 TiB)
IECByteSize.pib( 42 ) #=> (42 PiB)
IECByteSize.eib( 42 ) #=> (42 EiB)
IECByteSize.zib( 42 ) #=> (42 ZiB)
IECByteSize.yib( 42 ) #=> (42 YiB)
Constant Summary collapse
- BASE =
:stopdoc:
IEC_BASE
- UNIT_SYMBOLS =
IEC_UNIT_SYMBOLS
- ORDERS_OF_MAGNITUDE =
IEC_ORDERS_OF_MAGNITUDE
Constants inherited from ByteSize
ByteSize::ALL_ORDERS_OF_MAGNITUDE, ByteSize::ALL_UNIT_SYMBOLS, ByteSize::BYTES_REGEX, ByteSize::IEC_BASE, ByteSize::IEC_ORDERS_OF_MAGNITUDE, ByteSize::IEC_REGEX, ByteSize::IEC_UNIT_SYMBOLS, ByteSize::SI_BASE, ByteSize::SI_ORDERS_OF_MAGNITUDE, ByteSize::SI_REGEX, ByteSize::SI_UNIT_SYMBOLS, ByteSize::VERSION
Instance Attribute Summary
Attributes inherited from ByteSize
Method Summary
Methods inherited from ByteSize
#%, #*, #**, #+, #+@, #-, #-@, #/, #<, #<=, #<=>, #==, #>, #>=, bytes, #coerce, #eql?, #hash, #initialize, #inspect, #negative?, new, parse, #positive?, #to_i, #to_iec, #to_s, #to_si, #zero?
Constructor Details
This class inherits a constructor from ByteSize