Sha256: c89733d195c6ef35d73e19bb58d22dc9136e35ede4e9f2e8c5ee9c6456a7125d
Contents?: true
Size: 366 Bytes
Versions: 9
Compression:
Stored size: 366 Bytes
Contents
module Logistics module Core class UnitService < BaseService def convert_unit(amount, abbreviation, to_base = true) rate = Unit.find_by(abbreviation: abbreviation).rate_to_base if rate to_base ? amount / rate : amount * rate else raise 'You have no unit conversion rate' end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems