protected function toJson(RateInterface $rate)
    {
        return json_encode(array(
            'sourceName' => $rate->getSourceName(),
            'value' => $rate->getValue(),
            'currencyCode' => $rate->getCurrencyCode(),
            'rateType' => $rate->getRateType(),
            'date' => $rate->getDate()->format(\DateTime::ATOM),
            'baseCurrencyCode' => $rate->getBaseCurrencyCode(),
            'createdAt' => $rate->getCreatedAt()->format(\DateTime::ATOM),
            'modifiedAt' => $rate->getModifiedAt()->format(\DateTime::ATOM),
        ));
    }