updateRate method

ExchangeRate updateRate(
  1. String base,
  2. String currency,
  3. num amount,
  4. [String via]
)

Update basecurrency exchange rate to amount.

Implementation

ExchangeRate updateRate(String base, String currency, num amount,
    [String via]) {
  ExchangeRate rate = data[base];
  rate.to[currency].value = amount;
  debugPrint('Updated ${rate.from} -> $currency = $amount' +
      (via != null ? '(via $via)' : ''));
  return rate;
}