lib/da_money/money.rb
def conversion_rate(target_currency)
      if DaMoney::Money.conversion_rates.key? self.currency
        if DaMoney::Money.conversion_rates[self.currency].key? target_currency
          DaMoney::Money.conversion_rates[self.currency][target_currency].to_f
        else
          raise Exception.new("Conversion rate from '#{self.currency}' to '#{target_currency}'" +
            " if not configured!")
        end
      else
        raise Exception.new("Curreny '#{self.currency}' is not configured!")
      end
    end
# Returns the conversion rate from the current currency to a target currency.
# Checks if the current currency is configured as a base currency and
# and if it contains a rate for the target currency.
# 
# @return [Float]
Returns the conversion rate from the current currency to a target currency.
Checks if the current currency is configured as a base currency and
and if it contains a rate for the target currency.
Returns the conversion rate from the current currency to a target currency . Checks if the current currency is configured as a base currency and and if it contains a rate for the target currency .
def conversion_rate(target_currency)
      if DaMoney::Money.conversion_rates.key? self.currency
        if DaMoney::Money.conversion_rates[self.currency].key? target_currency
          DaMoney::Money.conversion_rates[self.currency][target_currency].to_f
        else
          raise Exception.new("Conversion rate from '#{self.currency}' to '#{target_currency}'" +
            " if not configured!")
        end
      else
        raise Exception.new("Curreny '#{self.currency}' is not configured!")
      end
    end
def conversion_rate ( target_currency ) if DaMoney :: Money . conversion_rates . key? self . currency if DaMoney :: Money . conversion_rates [ self . currency ] . key? target_currency DaMoney :: Money . conversion_rates [ self . currency ] [ target_currency ] . to_f else raise Exception . new ( "Conversion rate from '#{self.currency}' to '#{target_currency}'" + " if not configured!" ) end else raise Exception . new ( "Curreny '#{self.currency}' is not configured!" ) end end
Returns the conversion rate from the current currency to a target currency.
Returns the conversion rate from the current currency to a target currency .
None
Float
target_currency