Sha256: 3812e1f941e340f36e5c7d62d443451e165353ad492bfff6a052507e8d370b56
Contents?: true
Size: 564 Bytes
Versions: 6
Compression:
Stored size: 564 Bytes
Contents
module MoneyHelper extend ActiveSupport::Concern included do setup do Economy.cache.clear usd_to_uyu = Economy::Exchange.create( service: 'Yahoo', from: 'USD', to: 'UYU', rate: 20 ) usd_to_uyu.run_callbacks :commit uyu_to_usd = Economy::Exchange.create( service: 'Yahoo', from: 'UYU', to: 'USD', rate: 0.05 ) uyu_to_usd.run_callbacks :commit end end private def money(amount, currency) Economy::Money.new amount, currency end end
Version data entries
6 entries across 6 versions & 1 rubygems