Method: DawandaConverter::Money#convert_to

Defined in:
lib/dawanda_converter/money.rb

#convert_to(currency) ⇒ Object



39
40
41
42
43
44
45
46
# File 'lib/dawanda_converter/money.rb', line 39

def convert_to(currency)
   unless @@conversions.empty? || @@conversions[self.currency].nil?
     self.amount = @@conversions[self.currency][currency].to_f * self.amount
     self.currency = currency
   else
     puts "You must initialize conversion rates first."
   end
end