Methods
E
N
Constants
EXCHANGE_RATES = { "USD_TO_DKK" => 6, "DKK_TO_USD" => 0.6 }
 
Attributes
[R] amount
[R] currency
Class Public methods
new(amount, currency = "USD")
# File rails/activerecord/test/fixtures/customer.rb, line 28
def initialize(amount, currency = "USD")
  @amount, @currency = amount, currency
end
Instance Public methods
exchange_to(other_currency)
# 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