module Lite::Measurements::Helpers::ShiftHelper

Private Instance Methods

change_units(units, type:, from: nil, to: nil) click to toggle source
# File lib/lite/measurements/helpers/shift_helper.rb, line 10
def change_units(units, type:, from: nil, to: nil)
  if from
    units * type[from]
  else
    units / type[to]
  end
end
equal_units?(from, to) click to toggle source
# File lib/lite/measurements/helpers/shift_helper.rb, line 18
def equal_units?(from, to)
  from == to
end
shift_units(units, type:, from: nil, to: nil) click to toggle source
# File lib/lite/measurements/helpers/shift_helper.rb, line 22
def shift_units(units, type:, from: nil, to: nil)
  units = change_units(units, type: type, from: from)
  change_units(units, type: type, to: to)
end