class Lite::Measurements::DigitalStorage
Constants
- DIGITAL_STORAGE_UNITS
Public Instance Methods
convert(from:, to:)
click to toggle source
# File lib/lite/measurements/digital_storage.rb, line 19 def convert(from:, to:) assert_all_valid_keys!(from, to, DIGITAL_STORAGE_UNITS.keys) return amount if equal_units?(from, to) shift_units(amount, type: DIGITAL_STORAGE_UNITS, from: from, to: to) end