class Lite::Measurements::Time

Constants

TIME_UNITS

Public Instance Methods

convert(from:, to:) click to toggle source
# File lib/lite/measurements/time.rb, line 22
def convert(from:, to:)
  assert_all_valid_keys!(from, to, TIME_UNITS.keys)
  return amount if equal_units?(from, to)

  shift_units(amount, type: TIME_UNITS, from: from, to: to)
end