class MoneyExchange::Money

Attributes

amount[R]
currency[R]

Public Class Methods

new(amount, currency) click to toggle source
# File lib/money_exchange.rb, line 25
def initialize(amount, currency)
  @amount = Float(amount)
  @currency = currency
end

Public Instance Methods

method_missing(meth, *a, &b) click to toggle source
Calls superclass method
# File lib/money_exchange.rb, line 30
def method_missing(meth, *a, &b)
  case meth
  when /^to_([a-z]{3})$/
    Exchange.calc(self, $~[1])
  else
    super
  end
end