Methods
- E
- N
Constants
EXCHANGE_RATES | = | { "USD_TO_DKK" => 6, "DKK_TO_USD" => 0.6 } |
Attributes
[R] | amount | |
[R] | currency |
Class Public methods
Source: show
# File rails/activerecord/test/fixtures/customer.rb, line 28 def initialize(amount, currency = "USD") @amount, @currency = amount, currency end
Instance Public methods
Source: show
# File rails/activerecord/test/fixtures/customer.rb, line 32 def exchange_to(other_currency) Money.new((amount * EXCHANGE_RATES["#{currency}_TO_#{other_currency}"]).floor, other_currency) end