public function getRate($fromCurrency, $toCurrency)
    {
        if ($fromCurrency === $toCurrency) {
            return 1;
        }

        $currencyString = "{$fromCurrency}-{$toCurrency}";
        if (!isset($this->rates[$currencyString])) {
            throw new NoExchangeRateException(sprintf(
                'Cannot convert %s to %s, no exchange rate found.',
                $fromCurrency,
                $toCurrency
            ));
        }

        return $this->rates[$currencyString];
    }